1.VB HTTPS POST
2.vb post/get åºå«
VB HTTPS POST
é¦éæ·»å å¼ç¨ï¼microsoft xml 6.0 æç¨çæ¯6.0 å¦æä½ æ²¡æå»å®è£ xml6å§ã
æ·»å å®æåï¼æ·»å 以ä¸ä»£ç å³å¯å®æPOSTæ°æ®åé
Option Explicit
Dim xml As XMLHTTP
Private Sub Command1_Click()
xml.open "POST",源码大理桃源码头游船时间 "/", True '注ææ¯POST请æ±ï¼å½ç¶ä¹å¯ä»¥get
xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Dim str As String
str = str & "wd=å ³é®" 'å¯ä»¥å¨è¿éæ·»å åæ°
str = p_URLEncoding(str) 'éè¦å°POSTçæ°æ®è¿è¡ç¼ç
xml.send str
End Sub
Private Sub Form_Load()
Set xml = New XMLHTTP
End Sub
'ç¼ç å½æ°
Private Function p_URLEncoding(vstrIn) As String
'/////////////////////////////////////////////////
'解å³ç¼ç 转æ¢é®é¢ POST GB ç¼è¾çæ°æ®
Dim i As Long
Dim strReturn As String
Dim ThisChr As String
Dim innerCode As Long
Dim Hight8 As Long
Dim Low8 As Long
strReturn = ""
For i = 1 To Len(vstrIn)
ThisChr = Mid(vstrIn, i, 1)
If Abs(Asc(ThisChr)) < &HFF Then
strReturn = strReturn & ThisChr
Else
innerCode = Asc(ThisChr)
If innerCode < 0 Then
innerCode = innerCode + &H
End If
Hight8 = (innerCode And &HFF) \ &HFF
Low8 = innerCode And &HFF
strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)
End If
Next
p_URLEncoding = strReturn
End Function
vb post/get åºå«
FORM POSTæ¹æ³çåºå«è¡¨æ ¼GETåPOSTæ¹æ³ï¼æ°æ®ä¼ è¾è¿ç¨ä¸ï¼åå«ï¼ç¸åºçGETåPOSTæ¹æ³çHTTPåè®®ã两个主è¦çå·®å¼å¦ä¸ï¼
1ï¼ç¨äºä»æå¡å¨è·åæ°æ®ï¼èé®æ¿æ¯ç¨æ¥ä¼ è¾æ°æ®å°æå¡å¨ã
2ï¼è·åçè¡å¨ææåçURLåé¢æ·»å åé=å¼çå½¢å¼æç §è¡¨æ ¼ä¸çæ°æ®ï¼é½ä½¿ç¨äºâï¼âä¹é´çè¿æ¥ä½¿ç¨âï¼âè¿æ¥çæ¯ä¸ªåé;å表ä¸çæ°æ®çè¡¨æ ¼ä¸ææä¾çæ°æ®ä½çå½¢å¼ï¼æ ¹æ®çåéåå¼ï¼ä»¥ç¸åºçæ¹å¼ï¼å®è¢«ä¼ éç»è¯¥æä½ææåçURLã
3ï¼ä¸å®å ¨çï¼å 为å¨ä¼ è¾è¿ç¨ä¸ï¼æ°æ®è¢«æ¾ç½®å¨æ请æ±çURLï¼èç°å¨è®¸å¤ç°æçæå¡å¨ï¼ä»£çæå¡å¨æè ç¨æ·ä»£çå°è¯·æ±çURLå°ä¸ä¸ªæ¥å¿æ件ï¼ç¶åæ¾å¨æ个å°æ¹ï¼æä»¥ä½ å¯è½æä¸äºç¬¬ä¸æ¹çéç§ä¿¡æ¯ãæ¤å¤ï¼ç¨æ·è¿å¯ä»¥ç´æ¥å¨æµè§å¨ä¸çå°æ交çæ°æ®ï¼ç³»ç»å é¨çä¿¡æ¯å°æ¾ç¤ºå¨ç¨æ·é¢åãå表çæææä½çç¨æ·æ¯ä¸å¯è§çã
4ä¼ è¾çæ°æ®éå°ï¼è¿ä¸»è¦æ¯å 为URLé¿åº¦çéå¶;åå¯ä»¥ä¼ è¾å¤§éçæ°æ®ï¼æ以åªè½ä¸ä¼ æ件åï¼å½ç¶ï¼è¿æä¸ä¸ªåå æ¯åé¢æå°ï¼ã
éå¶Form表åçæ°æ®éçå¼å¿ 须为ASCIIå符;åæ´ä¸ªISOå符éçæ¯æã
6ï¼è·å表åçé»è®¤æ¹æ³ã
-------------------------------临æ¶çå®èªå·±çç解å»---- -----------------