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

请问这段asp代码怎么转化为C#的asp.net代码
<%
Dim   xml,codes,MyArray,d1,d2
Set   xml=Server.CreateObject( "Microsoft.XMLHTTP ")
xml.open   "get ", "/ipauth.asp?userip= "&request( "userip "),false
xml.send
codes=bytes2BSTR(xml.responseBody)  

Function   bytes2BSTR(arrBytes)  
strReturn   =   " "  
arrBytes   =   CStr(arrBytes)  
For   i   =   1   To   LenB(arrBytes)  
ThisCharCode   =   AscB(MidB(arrBytes,   i,   1))  
If   ThisCharCode   <   &H80   Then  
strReturn   =   strReturn   &   Chr(ThisCharCode)  
Else  
NextCharCode   =   AscB(MidB(arrBytes,   i+1,   1))  
strReturn   =   strReturn   &   Chr(CLng(ThisCharCode)   *   &H100   +   CInt(NextCharCode))  
i   =   i   +   1  
End   If  
Next  
bytes2BSTR   =   strReturn  
End   Function  
%>
Microsoft.XMLHTTP在C#中用什么类来实现
谢谢

------解决方案--------------------
恐怕不能
------解决方案--------------------
//Microsoft.XMLHTTP在C#中用什么类来实现
在C#不存在这要一个类,但是在C#中有很多类都可以实现它的功能,如webrequest.webclient
这样回答总可以了吧!