|

楼主 |
发表于 2014-5-4 21:37:12
|
显示全部楼层
- Public Shared Function ClientLogin(ByVal wc As WizardHTTP, ByVal id As String, _
- ByVal pw As String, ByVal vcode As String, _
- ByVal vmd5 As String) As LoginResult
- Dim cid As String = GetStampMobile(True)
- Dim poststr As String = "_client_id=" + cid + "&_client_type=2&_client_version=1.0.1&_phone_imei=000000000000000" + _
- "&from=baidu_appstore&isphone=0&net_type=1&passwd=" + ToBase64(pw) + "&un=" + id + _
- "&vcode=" + vcode + "&vcode_md5=" + vmd5
- Dim sign As String = MD5Encrypt(poststr.Replace("&", "") + "tiebaclient!!!", Encoding.UTF8)
- poststr = "_client_id=" + cid + "&_client_type=2&_client_version=1.0.1&_phone_imei=000000000000000" + _
- "&from=baidu_appstore&isphone=0&net_type=1&passwd=" + ToBase64(pw) + "&un=" + _
- URLEncoding(id, Encoding.UTF8) + "&vcode=" + vcode + "&vcode_md5=" + vmd5 + "&sign=" + sign
- wc.SetDefaultHeader(True)
- Dim retstr As String = wc.UploadString("http://c.tieba.baidu.com/c/s/login", poststr)
- Dim json As JsonData = JsonMapper.ToObject(retstr)
- vmd5 = ""
- Dim ndvcode As Integer
- Try
- ndvcode = json.Item("anti").Item("need_vcode")
- Catch ex As Exception
- ndvcode = 0
- End Try
- If ndvcode = 1 Then '需要验证码
- vmd5 = json.Item("anti").Item("vcode_md5")
- End If
- Dim errno As String = json.Item("error_code")
- If errno <> "0" Then
- Dim errmsg As String = json.Item("error_msg")
- Return New LoginResult(Convert.ToInt32(errno), errmsg, vmd5, "")
- Else
- Dim cookie As String = "BDUSS=" + CType(json.Item("user").Item("BDUSS"), String)
- Return New LoginResult(0, "", "", cookie)
- End If
- End Function
复制代码
其中有很多我自定义的函数啥的。。凑和着看吧 |
|