VB如何制作WindowsCGI应用程序-大悟县灿优商贸网站建设

关于灿优商贸

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

VB如何制作WindowsCGI应用程序

这篇文章主要介绍“VB如何制作Windows CGI应用程序”,在日常操作中,相信很多人在VB如何制作Windows CGI应用程序问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”VB如何制作Windows CGI应用程序”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

成都创新互联主营港口网站建设的网络公司,主营网站建设方案,成都app软件开发,港口h5小程序开发搭建,港口网站营销推广欢迎港口等地区企业咨询

下面举一个较复杂实用的WindowsCGI程序,它由4个子过程组成:CGI_Main(),EnterGuest(),ReturnForm()和Inter_Main();它的功能是:服务器向申请连接的Web客户发出一张表单,Web客户在表单里填入有关数据后送回服务器,服务器收到Web客户的数据并将它们写入一个文件中存储起来,同时向Web客户发送一个收条。这个WindowsCGI应用程序的工作流程如下:一当Web客户要求CGI连接,服务器运行该CGI程序,首先执行CGI_Main()过程,CGI_Main()过程调用ReturnForm()向Web客户送出一个表单,如果Web客户填了意见表,并按键寄回服务器(此时过程CGI_Main()中CGI_RequestMethod="POST"成立)则由CGI_Main()过程调用EnterGuest()获取客户发来的数据并将其放入文件guestbk.csv中,同时向Web客户返回一个信息回条表示客户表单已收到。

由于编译使用这个CGI程序的做法与上面完全相同,故下面仅给源程序代码:

OptionExplicit  ConstBOOK_FILE="guestbk.csv"'存放客户  数据的文件,自动生成,可用Excel97调阅  DeclareSubSleepLib"kernel32"  (ByValdwMillisecondsAsLong)  SubCGI_Main()  IfCGI_RequestMethod="POST"Then EnterGuest  Beep  Else  ReturnForm  EndIf  EndSub'

一当Web客户要求CGI连接,服务器执行ReturnForm(),送出征求建议的表单:

SubReturnForm()  Send"Content-type:text/html"  Send""  Send("贵州大学  TITLE>HEAD>")  Send("<BODY><H2>欢迎您访问贵州  大学计算机软件与理论研究所WWW站点H1>")  Send("我们的e-mail是<AHREFAHREF=""mailto:"  &CGI_ServerAdmin&_  """>lixiang@gzu.edu.cn:A>")  Send("<HR>")  Send("请填下表,留下您的宝贵建议:")  Send("<FORMACTIONFORMACTION="""  &CGI_ExecutablePath&"""METHOD=""POST"">")  Send("<PRE>您的姓名:  <INPUTSIZEINPUTSIZE=25NAME=""name"">")  Send("E-mail地址:  <INPUTSIZEINPUTSIZE=25NAME=""email"">")  Send("您给我们的建议:<TEXTAREACOLSTEXTAREACOLS=40 ROWS=4WRAP=VIRTUALNAME=""comments"">")  Send("TEXTAREA>PRE>")  Send("请击此处将您的建议送我们:  <INPUTTYPEINPUTTYPE=""submit""")  Send("VALUE=""发送您的建议"">")  Send("<HR>")  Send("FORM>BODY>HTML>")  EndSub  '获取客户建议表单数据,将所填数据存入文件guestbk.csv并向客户返回一个信息  SubEnterGuest()  DimiLockTriesAsInteger  DimsDateAsString  DimsNameAsString  DimsEmailAsString  DimsCommentsAsString  'DimsBrowserAsString  DimsFirstNameAsString  DimfnAsInteger  '提取建议的有关数据:  sName=GetSmallField("name")  sEmail=GetSmallField("email")  sComments=GetSmallField("comments")  iLockTries=0 fn=FreeFile OnErrorGoTogLockFail  gRetryLock:  OpenApp.Path+"\"+BOOK_FILEFor  AppendLockReadWriteAs#fn  OnErrorGoTo0  sDate=Now Write#fn,sDate,sName,sEmail,  sComments,CGI_RemoteAddr  Close#fn  sFirstName=Trim$(Left$(sName,  InStr(sName,"")))  IfsFirstName<>""  ThensFirstName=sFirstName&","  Send("Content-type:text/html")  Send("")  Send("<HTML><HEAD><TITLE>谢谢您!  TITLE>HEAD>")  Send("您的签名与建议是:<PRE>")  Send("日期:"&sDate)  Send("姓名:"&sName)  Send("E-Mail:"&sEmail)  Send("Hostaddress:  ["&CGI_RemoteAddr&"]")  Send("建议:PRE>")  Send(sComments)  Send("<H2>谢谢您!H2>")  Send("BODY>HTML>")  ExitSub  gLockFail:  Sleep(1000)  iLockTriesiLockTries=iLockTries+1  ResumegRetryLock  EndSub  SubInter_Main()  MsgBox"这是CGI程序,  需要在Web服务器中运行。",16,"CGI.BAS"  EndSub</pre><p>到此,关于“VB如何制作Windows CGI应用程序”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!</p>            
            
                        <br>
            分享标题:VB如何制作WindowsCGI应用程序            <br>
            URL网址:<a href="http://www.apyobr.com/article/ighpoj.html">http://www.apyobr.com/article/ighpoj.html</a>
        </div>
    </div>
    <div class="other">
        <h3>其他资讯</h3>
        <ul>
            <li>
                    <a href="/article/ichjgj.html">自动设置时区,你好自动时区怎么关</a>
                </li><li>
                    <a href="/article/ichjhc.html">南通网站制作哪个好,合肥建设网站制作哪个好</a>
                </li><li>
                    <a href="/article/ichjhh.html">域名为什么要钱,注册网址域名要钱吗</a>
                </li><li>
                    <a href="/article/ichjjo.html">中视频如何加入,新手怎么加入中视频计划</a>
                </li><li>
                    <a href="/article/ichjjj.html">css字体图标如何制作,字体图标库css</a>
                </li>        </ul>
    </div>
</div>
<div class="line"></div>
<!--底部-->
<footer id="5">
    <div class="foot1 container">
        <div class="list">
            <div class="item">
                <a href="javascript:;">
                    <span class="ico1"><i class="iconfont"></i><img src="/Public/Home/img/ewm.png" alt=""></span>
                    <strong>关注我们</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>索要报价</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>我要咨询</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>找到我们</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>投诉建议</strong>
                </a>
            </div>
        </div>
        <div class="tel">
            <dl>
                <tel><a href="tel:18982081108" target="_blank">18982081108</a></tel><br>
                <span>也许您需要专业的服务,欢迎来电咨询</span>
            </dl>
            <dl>
                <tel><a href="tel:18980820575" target="_blank">18980820575</a></tel><br>
                <span>您的需求,是我们前进的动力</span>
            </dl>
        </div>
    </div>
    <div class="friend">
        <div class="container">
            <span class="tit">友情链接:</span>
            <div class="inner">
                <a href="https://www.cdcxhl.com/wangzhandingzhi.html" target="_blank">成都企业网站定制</a><a href="https://www.cdcxhl.com/hangyead/" target="_blank">1元广告</a><a href="https://www.cdcxhl.com/link/" target="_blank">买链接</a><a href="https://www.cdcxhl.com/" target="_blank">网站设计</a><a href="https://www.cdcxhl.com/xiaochengx.html" target="_blank">小程序开发公司</a><a href="https://www.cdcxhl.com/h5.html" target="_blank">成都h5网站建设</a><a href="https://www.cdcxhl.com/xiyun.html" target="_blank">西云服务器托管</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文推广</a><a href="https://www.cdcxhl.com/" target="_blank">网站制作</a><a href="https://www.cdcxhl.com/link/" target="_blank">外链</a><a href="https://www.cdcxhl.com/app.html" target="_blank">成都app软件开发公司</a><a href="https://www.cdcxhl.com/weihu/" target="_blank">网站维护</a><a href="https://www.cdcxhl.com/jigui/" target="_blank">机柜租用</a><a href="https://www.cdcxhl.com/link/" target="_blank">买友情链接</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文发布</a><a href="https://www.cdcxhl.com/app.html" target="_blank">app软件开发</a><a href="https://www.cdcxhl.com/" target="_blank">成都网站设计公司</a><a href="https://www.cdcxhl.com/gaofang/" target="_blank">高防服务器</a>            </div>
        </div>
    </div>
    <div class="foot">
        <div class="container">
            <div class="footNav">
                <h3>网站建设</h3>
                <a href="https://www.cdxwcx.com/" target="_blank">成都网站建设</a><a href="http://www.cdkjz.cn/fangan/zhongbiao/" target="_blank">奢侈品网站建设方案</a><a href="http://www.cddcz.com/" target="_blank">成都网站建设</a>            </div>
            <div class="footNav">
                <h3>服务器托管</h3>
                <a href="https://www.cdxwcx.com/jifang/xiyun.html" target="_blank">成都西云机房</a><a href="https://www.cdxwcx.com/jifang/yaan.html" target="_blank">雅安服务器托管</a><a href="http://www.cdxwcx.cn/tuoguan/mianyang.html" target="_blank">绵阳机房托管</a>            </div>
            <div class="footNav">
                <h3>网站制作</h3>
                <a href="http://chengdu.cdcxhl.com/" target="_blank">成都营销网站制作</a><a href="http://m.cdcxhl.cn/mobile/" target="_blank">手机网站制作</a><a href="http://www.myzwz.com/" target="_blank">绵阳网站制作</a>            </div>
            <div class="footNav">
                <h3>企业服务</h3>
                <a href="https://www.cdcxhl.com/ruanwen/yingxiao/" target="_blank">软文推广</a><a href="https://www.cdcxhl.com/shoulu/" target="_blank">网站收录</a><a href="https://www.cdcxhl.com/service/wenwangwen.html" target="_blank">网络文化经营许可证</a>            </div>
            <div class="fr ecode">
                <div class="fl">
                    <img src="/Public/Home/img/ewm.jpg">
                    <p>关注企业微信</p>
                </div>
                <div class="fr slogan">
                    <p class="icon">
                        <a class="ph" href=""><i class="iconfont"></i></a>
                        <a class="qq" href="tencent://message/?uin=1683211881&Site=&Menu=yes"><i class="iconfont"></i></a>
                    </p>
                    <p>
                        <i>想要找 </i> <a href="https://www.cdcxhl.com/xiaochengx.html">小程序开发</a>、<a href="https://www.cdcxhl.com/app.html">APP开发</a>、
                        <a href="https://www.cdcxhl.com/yingxiao.html">营销型网站建设</a>、<a href="https://www.cdxwcx.com/">网站建设</a>、
                        <i><a href="https://www.cdcxhl.com/wangzhandingzhi.html">网站定制开发</a></i> ,就选<a href="http://www.apyobr.com/">灿优商贸</a>
                    </p>
                </div>
            </div>
        </div>
        <div class="bottom container">
            <p class="fl">
                版权所有:大悟县灿优商贸有限公司
                备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">鄂ICP备2025125667号-8</a>
                服务热线:18982081108
            </p>
            <p class="fr">
                <a href="https://www.cdxwcx.com/" target="_blank">成都网站建设</a>:
                <a href="https://www.cdcxhl.com/" target="_blank">创新互联</a>
            </p>
        </div>
    </div>
</footer>
<!--在线咨询-->
<div class="fot">
    <ul>
        <li>
            <a href="#" target="_blank">
                <img src="/Public/Home/img/fot1.png" alt="">
                <p>在线咨询</p>
            </a>
        </li>
        <li>
            <a href="tel:18980820575" target="_blank">
                <img src="/Public/Home/img/fot2.png" alt="">
                <p>拨打电话</p>
            </a>
        </li>
    </ul>
</div>
</body>
</html>
<script>
    $(".con img").each(function(){
        var src = $(this).attr("src");    //获取图片地址
        var str=new RegExp("http");
        var result=str.test(src);
        if(result==false){
            var url = "https://www.cdcxhl.com"+src;    //绝对路径
            $(this).attr("src",url);
        }
    });
    window.onload=function(){
        document.oncontextmenu=function(){
            return false;
        }
    }
</script>