inet Execute后返回的页面全部是乱码 100RMB 酬谢
Private Sub send_Click()
Dim posturl As String
Dim postdata As String
Dim posth As String
posturl = "https://mlogin.plaync.co.kr/session"
postdata = "return_to=http%3A%2F%2Fm.aion.plaync.co.kr%2F&user_session%5Blogin%5D=" & Uid.Text & "&user_session%5Bpassword%5D=" & Upwd.Text & "&x=28&y=36"
posth = "Referer: https://mlogin.plaync.co.kr/session/new?login=1&return_to=http%3A%2F%2Fm.aion.plaync.co.kr%2F" & vbCrLf & "Accept-Language: ko" & vbCrLf & "Content-Type: application/x-www-form-urlencoded" & vbCrLf & "Accept-Encoding: gzip, deflate" & vbCrLf & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; @zb8an9MQ>o>m=:V=VMI>ST+M3LC2mp%k-<CD; InfoPath.2)" & vbCrLf & "Host: mlogin.plaync.co.kr"
Inet1.Execute posturl, "post", postdata, posth
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
If State = 12 Then
Dim BinBuff() As Byte
BinBuff = Inet1.GetChunk(0, icByteArray)
RichTextBox1.Text = Utf8ToUnicode(BinBuff)
End If
end sub
'utf-8转换UNICODE代码
Option Explicit
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpMultiByteStr As Long, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
Private Const CP_UTF8 = 65001
Function Utf8ToUnicode(ByRef Utf() As Byte) As String
Dim lRet As Long
Dim lLength As Long
Dim lBufferSize As Long
lLength = UBound(Utf) - LBound(Utf) + 1
If lLength <= 0 Then Exit Function
lBufferSize = lLength * 2
Utf8ToUnicode = String$(lBufferSize, Chr(0))
lRet = MultiByteToWideChar(CP_UTF8, 0, VarPtr(Utf(0)), lLength, StrPtr(Utf8ToUnicode), lBufferSize)
If lRet <> 0 Then
Utf8ToUnicode = Left(Utf8ToUnicode, lRet)
Else
Utf8ToUnicode = ""
End If
End Function
根据网上搜集的资料写的,转换UNICODE代码 ,可是最后 RichTextBox1.Text 显示的还是乱码。。。求高手指正下哪里出错了,
postdata=的 uid 和upwd 是帐号密码。这里给个该网站正确的账号 popolhj1 密码 newpsw915
联系QQ:28506641 .100RMB 酬谢。
[解决办法]
该回复于2012-03-19 11:19:21被版主删除