基本信息
源码名称:vb post协议头整理工具源码
源码大小:0.13M
文件格式:.zip
开发语言:ASP
更新时间:2016-06-27
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
VERSION 5.00 Begin VB.Form Form1 BorderStyle = 1 'Fixed Single Caption = "新版Post协议头整理工具" ClientHeight = 7575 ClientLeft = 45 ClientTop = 435 ClientWidth = 15240 Icon = "Form1.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 7575 ScaleWidth = 15240 StartUpPosition = 2 '屏幕中心 Begin VB.CommandButton Command3 Caption = "vb.6.0 WinHttp" Height = 375 Left = 2400 TabIndex = 7 Top = 3360 Width = 2175 End Begin VB.CommandButton Command2 Caption = "vb.net" Height = 375 Left = 1560 TabIndex = 6 Top = 7080 Width = 2175 End Begin VB.Timer Timer1 Interval = 200 Left = 7320 Top = 3360 End Begin VB.CommandButton Command4 Caption = "vb.6.0" Height = 375 Left = 120 TabIndex = 5 Top = 7080 Width = 1335 End Begin VB.Frame Frame2 Caption = "协议头参数提取" Height = 3135 Left = 120 TabIndex = 3 Top = 3840 Width = 15015 Begin VB.TextBox Text2 Height = 2775 Left = 120 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 4 Top = 240 Width = 14775 End End Begin VB.Frame Frame1 Caption = "协议头整理区" Height = 3135 Left = 120 TabIndex = 1 Top = 120 Width = 15015 Begin VB.TextBox Text1 Height = 2775 Left = 120 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 2 Top = 240 Width = 14775 End End Begin VB.CommandButton Command1 Caption = "vb.net HttpWebRequest" Height = 375 Left = 120 TabIndex = 0 Top = 3360 Width = 2175 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Long Private Declare Function SkinH_SetAero Lib "SkinH.dll" (ByVal hwnd As Long) As Long Private Declare Function SkinH_Attach Lib "SkinH.dll" () As Long Private Declare Function SkinH_AttachEx Lib "SkinH.dll" (ByVal lpSkinFile As String, ByVal lpPasswd As String) As Long Private Declare Function GetForegroundWindow Lib "user32" () As Long Private Sub Command2_Click() Dim a Dim b As String Dim c As String Dim i As Integer Dim e As String a = Split(Text2.Text, vbCrLf) For i = LBound(a) To UBound(a) If Trim(a(i)) <> "" Then '排除空行 If InStr(Trim(a(i)), ": ") > 0 Then '判断是否符合处理条件 If InStr(Trim(a(i)), ": ") > 0 And InStr(Trim(a(i)), "=") > 0 Then e = e & "Dim " & Split(Split(Trim(a(i)), ": ")(1), "=")(0) & " As String" & vbCrLf If InStr(Trim(a(i)), ";") > 0 Then b = b & Split(Split(Trim(a(i)), ": ")(1), "=")(0) & " = " & "Split(Split(TextBox2.Text, " & Chr(34) & Split(Split(Trim(a(i)), ": ")(1), "=")(0) & "=" & Chr(34) & ")(1), " & Chr(34) & ";" & Chr(34) & ")(0)" & vbCrLf End If End If End If End If Next Text2.Text = e & vbCrLf & b On Error Resume Next Clipboard.Clear Clipboard.SetText Text2.Text MsgBox "代码已复制成功!", vbOKOnly, "提示" End Sub Private Sub Command3_Click() Dim a Dim b As String Dim c As String Dim i As Integer a = Split(Text1.Text, vbCrLf) For i = LBound(a) To UBound(a) If Trim(a(i)) <> "" Then '排除空行 If InStr(Trim(a(i)), ": ") > 0 Then '判断是否符合处理条件 If Left(Trim(a(i)), 26) <> "WinHttp.SetRequestHeader " & Chr(34) Then '排除已被处理行 If Left(Trim(a(i)), 16) = "Content-Length: " Then '判断是否为post b = b & "WinHttp.SetRequestHeader " & Chr(34) & "Content-Length" & Chr(34) & ", Len(ShuJu)" & vbCrLf Else c = Replace(Trim(a(i)), ": ", Chr(34) & "," & Chr(34)) b = b & "WinHttp.SetRequestHeader " & Chr(34) & c & Chr(34) & vbCrLf End If Else b = b & Trim(a(i)) & vbCrLf End If Else b = b & Trim(a(i)) & vbCrLf End If End If Next Text1.Text = b On Error Resume Next Clipboard.Clear Clipboard.SetText Text1.Text MsgBox "代码已复制成功!", vbOKOnly, "提示" End Sub Private Sub Form_Load() SkinH_Attach End Sub Private Sub Timer1_Timer() If GetAsyncKeyState(vbKeyF2) Then If GetForegroundWindow = Me.hwnd Then Dim a As Object Set a = CreateObject("WScript.shell") a.SendKeys Chr(34) & " & " & "^v" & " & " & Chr(34) End If End If End Sub Private Sub Command1_Click() Dim a() As String Dim b As String Dim c As Integer Dim d As String a = Split(删除所有空行(Text1.Text), vbCrLf) For c = LBound(a) To UBound(a) Dim qian As String Dim hou As String If Trim(a(c)) <> "" Then '排除空行 qian = "httpQonse." & Replace(Split(Trim(a(c)), ": ")(0), "-", "") hou = Chr(34) & Split(Trim(a(c)), ": ")(1) & Chr(34) If InStr(qian, "httpQonse.AcceptEncoding") < 1 And InStr(qian, "httpQonse.AcceptLanguage") < 1 And InStr(qian, "httpQonse.Connection") < 1 And InStr(qian, "httpQonse.Origin") < 1 And InStr(qian, "httpQonse.XRequestedWith") < 1 Then If InStr(qian, "httpQonse.ContentLength") > 0 Then d = d & "httpQonse.ContentLength = postByte.Length" & vbCrLf Else If InStr(qian, "httpQonse.Cookie") > 0 Then qian = "httpQonse.Headers.Set(" & Chr(34) & "Cookie" & Chr(34) & ", " d = d & qian & hou & ")" & vbCrLf Else d = d & qian & " = " & hou & vbCrLf End If End If End If End If Next c Text1.Text = d On Error Resume Next Clipboard.Clear Clipboard.SetText Text1.Text MsgBox "代码已复制成功!", vbOKOnly, "提示" End Sub Private Sub Command4_Click() Dim a Dim b As String Dim c As String Dim i As Integer Dim e As String a = Split(Text2.Text, vbCrLf) For i = LBound(a) To UBound(a) If Trim(a(i)) <> "" Then '排除空行 If InStr(Trim(a(i)), ": ") > 0 Then '判断是否符合处理条件 If InStr(Trim(a(i)), ": ") > 0 And InStr(Trim(a(i)), "=") > 0 Then e = e & "Dim " & Split(Split(Trim(a(i)), ": ")(1), "=")(0) & " As String" & vbCrLf If InStr(Trim(a(i)), ";") > 0 Then b = b & Split(Split(Trim(a(i)), ": ")(1), "=")(0) & " = " & "Split(Split(Text2.Text, " & Chr(34) & Split(Split(Trim(a(i)), ": ")(1), "=")(0) & "=" & Chr(34) & ")(1), " & Chr(34) & ";" & Chr(34) & ")(0)" & vbCrLf End If End If End If End If Next Text2.Text = e & vbCrLf & b On Error Resume Next Clipboard.Clear Clipboard.SetText Text2.Text MsgBox "代码已复制成功!", vbOKOnly, "提示" End Sub Public Function 删除所有空行(ByVal 文本 As String) As String '任何空行都会清空 Dim a() As String Dim b As Integer Dim c As String a = Split(文本, vbCrLf) For b = LBound(a) To UBound(a) If Trim(a(b)) <> "" Then c = c & Trim(a(b)) & vbCrLf End If Next b Do While Left(c, 1) = Chr(13) Or Left(c, 1) = Chr(10) c = Right(c, Len(c) - 1) Loop Do While Right(c, 1) = Chr(13) Or Right(c, 1) = Chr(10) c = Left(c, Len(c) - 1) Loop 删除所有空行 = c End Function