帮忙翻译段代码
这是用vb写的asp的代码,往手机发送短信的代码.在网上注册用户名时注册成功后会往手机上发短信
帮忙翻译成c#的asp.net代码
<%
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject( "adodb.stream ")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
mc_username= "username " '此处设置您的帐户
mc_password= "password " '此处设置您的帐户密码
mc_num=request( "mc_num ") '此处获取手机号码,多个号码请用半角逗号隔开
mc_content=request( "mc_content ") '此处获取发送内容,不多于60个字
set http = Server.CreateObject( "Microsoft.XMLHTTP ")
Http.Open "GET ", "http://sms.asp.sh.cn/mc.asp?mc_username= "&mc_username& "&mc_password= "&mc_password& "&mc_num= "&mc_num& "&mc_content= "&mc_content& " ",false
Http.Send
getHTTPPage=bytesToBSTR(Http.responseBody, "GB2312 ")
set http=nothing
%>
<%=getHTTPPage%>
------解决方案--------------------添加引用,在项目下有个References(英文版)点击右键,然后在COM那一页找到你那个就可以了
------解决方案--------------------MSDN看一下 HttpWebRequest.GetResponse方法的帮助,照着例子写就是了,很简单的
------解决方案--------------------最佳办法:
S1:编译成EXE
S2:使用Reflector反向,运行C#