日期:2014-05-18  浏览次数:20400 次

关于HttpWebRequest调用返回403,1的问题请教
Dim   hwr   As   HttpWebRequest   =   Nothing
            Dim   hws   As   HttpWebResponse   =   Nothing
         
Application(APP_SERVER_LINK)   &   "/ValSystem/Validate.aspx? "   &   _
                                                        Request.ServerVariables( "QUERY_STRING ")
            hwr   =   HttpWebRequest.Create(strURL)
            hwr.Method   =   "Get "
            hws   =   hwr.GetResponse()
            Dim   sr   As   StreamReader   =   New   StreamReader(hws.GetResponseStream,   Encoding.Default)                                  
            strResult   =   sr.ReadToEnd.Trim

这段代码是在WEB服务器上运行的。我需要实现的是从客户端发出http请求到该WEB服务器,这段代码把客户的请求转发到另一个服务器,并等待服务器返回,然后将结果返回给客户。   其中的stURL

------解决方案--------------------
hwr.CookieContainer = new CookieContainer();
hwr.Method = "Get "


*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)

http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html