7,763
社区成员
发帖
与我相关
我的任务
分享
Dim http As Object
Dim url As String
Dim str As String
Dim text As String
Dim page As String
Private Sub Command1_Click()
Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
url = "http://www.hebgb.gov.cn/portal/j_security_check"
str = "j_uri=%2Fportal%2Findex%21index.action&yzm=not&j_username=130303&j_password=888888&imgcode="
http.Open "POST", url, False
http.setrequestheader "Content-Type", "application/x-www-form-urlencoded"
http.setrequestheader "Content-Length", Len(str)
http.send str
If http.waitforresponse() Then
Clipboard.Clear
Clipboard.SetText http.responsetext
Else: MsgBox "失败"
End If
End Sub
Private Sub Command2_Click()
url = "http://www.hebgb.gov.cn/student/course!courseIndex.action"
page = "rowCount=607¤tPage=1&pageSize=20"
http.Open "POST", url, False
http.setrequestheader "Content-Length", Len(page)
http.send page
If http.waitforresponse() Then
Clipboard.Clear
Clipboard.SetText http.responsetext
Else: MsgBox "失败"
End If
End Sub