现在需要做一个自动升级系统,有一个windows forms 的升级程序(服务器端)每天准时向一个Web站点发送请求,获取最新的系统版本号,与本地系统的版本号进行对比,如果不是最新则从Web站点下载最新的系统。如何向一个C/S如何相B/S架构的站点发送请求呢?B/S又是如何接受并返回请求呢?有哪位大大有过类似的经验,还请不吝赐教,最好是有实现的具体细节,感激不尽。

解决方案 »

  1.   

    同意楼上的,webservice,或者直接http协议,request、respons获取网页返回内容。
      

  2.   

    WebService or Http 都可以。
    我用WebService实现的。
      

  3.   

    用webservice做接口,.net中的winform可以通过clickonce发布,有自动检测版本更新的。
      

  4.   

    嗯对的就是这个拉private   void   webBrowser_DocumentCompleted(object   sender,   WebBrowserDocumentCompletedEventArgs   e) 
                    { 
                            if   (this.webBrowser.Document   !=   null) 
                            { 
                                    HtmlElement   ok   =   this.webBrowser.Document.GetElementById( "ButtonOK "); 
                                    if   (ok   !=   null) 
                                    { 
                                            ok.Click   +=   new   HtmlElementEventHandler(ButtonOK_Click); 
                                    } 
                                    HtmlElement   cancel   =   this.webBrowser.Document.GetElementById( "ButtonCancel "); 
                                    if   (cancel   !=   null) 
                                    { 
                                            cancel.Click   +=   new   HtmlElementEventHandler(ButtonCancel_Click); 
                                    } 
                            } 
                    } 
     
     
     
      

  5.   

    这么简单的问题不用webservice,可以在服务器端添加一个txt文件,里面就保存最新的版本号
    本地的cs程序可以定期从服务器获取一些这个版本号即可。
    请求的话用WebRequest请求一下就可以了