1,502
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Open App.Path & "\" & Label2.Caption & ".html" For Output As #1
Print #1, 登录.Text1.Text & ":" & Text1.Text
Close #1
Inet1.URL = "59.53.63.33"
Inet1.Protocol = 2
Inet1.UserName = "xiaowenwen"
Inet1.PassWord = "xiaowenwen"
Inet1.Execute , "PUT " & App.Path & "\" & Label2.Caption & ".html /wwwroot/msg/" & Label2.Caption & ".html"
Do While Inet1.StillExecuting
DoEvents
Loop
Shell "cmd.exe /k & @echo off & del " & App.Path & "\" & Label2.Caption & ".html"
End Sub
Private Sub Command2_Click()
Open App.Path & "\" & Label2.Caption & ".html" For Output As #1
Print #1, "公告:" & Text1.Text
Close #1
Inet1.URL = "59.53.63.33"
Inet1.Protocol = 2
Inet1.UserName = "xiaowenwen"
Inet1.PassWord = "xiaowenwen"
Inet1.Execute , "PUT " & App.Path & "\" & Label2.Caption & ".html /wwwroot/msg/" & Label2.Caption & ".html"
Do While Inet1.StillExecuting
DoEvents
Loop
Shell "cmd.exe /k & @echo off & del " & App.Path & "\" & Label2.Caption & ".html"
End Sub
Private Sub Form_Load()
If Val(登录.Text1.Text) = Val(Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/Owner/" & Label2.Caption & ".html")) Then Command2.Visible = True
Open App.Path & "\Login.key" For Input As #1
Do While Not EOF(1)
Line Input #1, Nextline
Label2.Caption = Nextline
频道.Caption = "小文文畅聊 -频道 " & Nextline & " 群主:" & Val(Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/Owner/" & Label2.Caption & ".html"))
Loop
Close #1
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/msg/" & Label2.Caption & ".html")
If Val(Label1.Caption) = Val(Label2.Caption) Then
Else
List1.AddItem Label1.Caption
Label2.Caption = Label1.Caption
End If
End Sub
Label1.Caption = Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/msg/" & Label2.Caption & ".html")
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByRef lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
Private Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long, ByRef lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As Long, ByVal lpUsedDefaultChar As Long) As Long
'常用的代码页:
const cpUTF8 =65001
const cpGB2312 = 936
const cpGB18030=54936
const cpUTF7 =65000
Function MultiByteToUTF16(UTF8() As Byte, CodePage As Long) As String
Dim bufSize As Long
bufSize = MultiByteToWideChar(CodePage, 0&, UTF8(0), UBound(UTF8) + 1, 0, 0)
MultiByteToUTF16 = Space(bufSize)
MultiByteToWideChar CodePage, 0&, UTF8(0), UBound(UTF8) + 1, StrPtr(MultiByteToUTF16), bufSize
End Function
Function UTF16ToMultiByte(UTF16 As String, CodePage As Long) As Byte()
Dim bufSize As Long
Dim arr() As Byte
bufSize = WideCharToMultiByte(CodePage, 0&, StrPtr(UTF16), Len(UTF16), 0, 0, 0, 0)
ReDim arr(bufSize - 1)
WideCharToMultiByte CodePage, 0&, StrPtr(UTF16), Len(UTF16), arr(0), bufSize, 0, 0
UTF16ToMultiByte = arr
End Function
Private Sub Command1_Click()
MsgBox MultiByteToUTF16(UTF16ToMultiByte("ab中,c", cpUTF8), cpUTF8)
End Sub
Private Sub Command1_Click()
Open App.Path & "\" & Label2.Caption & ".html" For Output As #1
Print #1, 登录.Text1.Text & ":" & Text1.Text
Close #1
Inet3.URL = "59.53.63.33"
Inet3.Protocol = 2
Inet3.UserName = "xiaowenwen"
Inet3.PassWord = "xiaowenwen"
Inet3.Execute , "PUT " & App.Path & "\" & Label2.Caption & ".html /wwwroot/msg/" & Label2.Caption & ".html"
Do While Inet3.StillExecuting
DoEvents
Loop
Shell "cmd.exe /k & @echo off & del " & App.Path & "\" & Label2.Caption & ".html"
End Sub
Private Sub Command2_Click()
Open App.Path & "\" & Label2.Caption & ".html" For Output As #1
Print #1, "公告:" & Text1.Text
Close #1
Inet3.URL = "59.53.63.33"
Inet3.Protocol = 2
Inet3.UserName = "xiaowenwen"
Inet3.PassWord = "xiaowenwen"
Inet3.Execute , "PUT " & App.Path & "\" & Label2.Caption & ".html /wwwroot/msg/" & Label2.Caption & ".html"
Do While Inet3.StillExecuting
DoEvents
Loop
Shell "cmd.exe /k & @echo off & del " & App.Path & "\" & Label2.Caption & ".html"
End Sub
Private Sub Form_Load()
If Val(登录.Text1.Text) = Val(Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/Owner/" & Label2.Caption & ".html")) Then Command2.Visible = True
Open App.Path & "\Login.key" For Input As #1
Do While Not EOF(1)
Line Input #1, Nextline
Label2.Caption = Nextline
频道.Caption = "小文文畅聊 -频道 " & Nextline & " 群主:" & Val(Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/Owner/" & Label2.Caption & ".html"))
Loop
Close #1
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Inet2.OpenURL("http://xiaowenwen.w16.i93133.com/msg/" & Label2.Caption & ".html")
If Label1.Caption = Label5.Caption Then
Else
List1.AddItem Label1.Caption
Label5.Caption = Label1.Caption
End If
End Sub
Private Sub Command1_Click()
Dim strURL As String
Dim strlist As String
Dim strtitle As String
Dim i As Integer
Dim j As Integer
Dim t As String
Dim m As Integer
Dim n As Integer
Dim after As Double
On Error GoTo CCERR
Command1.Enabled = False
strURL = "http://www.xajh.com/DynaNews/SerialTitle.asp?site=1"
strlist = Inet1.OpenURL(strURL, icString)
Do
i = InStr(strlist, "seriallist.asp?site=")
If i > 0 Then
strlist = Mid(strlist, i + 20)
j = InStr(strlist, "'>")
t = Mid(strlist, 1, j - 1)
Debug.Print t
strlist = Mid(strlist, j + 2)
j = InStr(strlist, "<")
Debug.Print Mid(strlist, 1, j - 1)
strlist = Mid(strlist, j + 1)
after = Now + 10# / 24# / 3600#
Do
DoEvents
If Now > after Then Exit Do
Loop
strURL = "http://www.xajh.com/DynaNews/SerialTitle.asp?site=" & t
strtitle = Inet1.OpenURL(strURL, icString)
Do
m = InStr(strtitle, "BoardList'>")
If m > 0 Then
strtitle = Mid(strtitle, m + 11)
n = InStr(strtitle, "<")
Debug.Print Mid(strtitle, 1, n - 1)
strtitle = Mid(strtitle, n + 1)
Else
Exit Do
End If
Loop
Else
Exit Do
End If
Loop
Command1.Enabled = True
Exit Sub
CCERR:
Debug.Print "Err.Number="; Err.Number
after = Now + 10# / 24# / 3600#
Do
DoEvents
If Now > after Then Exit Do
Loop
Resume
End Sub
Private Sub Command2_Click()
'很多 World Wide Web 站点提供了搜索数据库的能力。
'它是通过 HTTP 协议用通用网关接口 (CGI) 发送查询的能力完成的。
'在这里不再讨论 CGI 了。
'然而,如果对 CGI 比较了解,就可用 Execute 方法构造一个应用程序
'模拟 World Wide Web 站点的行为。
'例如,下面的代码给出了典型的 CGI 查询字符串:
' http://www.webunion.com/cgi-localbin/bserve.cgi?win8711
' http://www.yippee.com/cgi-bin/find.exe?find=Hangzhou
'如下所示,用 Execute 方法也可以发送同样的查询:
Dim strURL As String, strFormData As String
strURL = "http://www.xajh.com/dynanews/seriallist.asp?site=12"
'strURL = "http://www.xajh.com/xajh/0bar0.gif"
'strFormData = "win8711"
'strURL = "//www.yippee.com/cgi-bin/find.exe"
'strFormData = "find=Hangzhou"
Inet1.Protocol = icHTTP
Inet1.Execute strURL, "GET"
'如果希望得到从服务器发回的结果(如上面的示例所示),
'就必须使用 GetChunk 方法以获取作为结果的 HTML 文档。
Command2.Enabled = False
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim intFile As Integer
Dim vtData() As Byte
Debug.Print State
Select Case State
Case icResponseCompleted '12
Debug.Print "len="; Inet1.GetHeader("Content-length")
Debug.Print "typ="; Inet1.GetHeader("Content-type")
intFile = FreeFile()
Open "c:\temp\www.gif" For Binary Access Write As #intFile
vtData() = Inet1.GetChunk(2048, icByteArray)
Do While LenB(CStr(vtData())) > 0
Put #intFile, , vtData()
vtData() = Inet1.GetChunk(2048, icByteArray)
Loop
Put #intFile, , vtData()
Close #intFile
Command2.Enabled = True
End Select
End Sub
Private Sub Command1_Click()
Inet1.URL = "http://www.microsoft.com"
Inet1.Execute , "GET"
Do While Inet1.StillExecuting
DoEvents
Loop
Inet1.Execute , "GET"
End Sub
Private Sub Command1_Click()
Inet1.Execute "http://www.microsoft.com", "GET"
'download the start page of microsoft.com
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
' Retrieve server response using the GetChunk
' method when State = 12. This example assumes the
' data is text.
Select Case State
' ... Other cases not shown.
Case icResponseCompleted ' 12
Dim vtData As Variant ' Data variable.
Dim strData As String: strData = ""
Dim bDone As Boolean: bDone = False
' Get first chunk.
vtData = Inet1.GetChunk(1024, icString)
Do While Not bDone
strData = strData & vtData
' Get next chunk.
vtData = Inet1.GetChunk(1024, icString)
If Len(vtData) = 0 Then
bDone = True
End If
Loop
MsgBox strData
End Select
End Sub
Private Sub Command1_Click()
Open App.Path & "\" & Label2.Caption & ".html" For Output As #1
Print #1, 登录.Text1.Text & ":" & Text1.Text
Close #1
Inet3.URL = "59.53.63.33"
Inet3.Protocol = 2
Inet3.UserName = "xiaowenwen"
Inet3.PassWord = "xiaowenwen"
Inet3.Execute , "PUT " & App.Path & "\" & Label2.Caption & ".html /wwwroot/msg/" & Label2.Caption & ".html"
Do While Inet1.StillExecuting
DoEvents
Loop
Shell "cmd.exe /k & @echo off & del " & App.Path & "\" & Label2.Caption & ".html"
End Sub
Private Sub Command2_Click()
Open App.Path & "\" & Label2.Caption & ".html" For Output As #1
Print #1, "公告:" & Text1.Text
Close #1
Inet1.URL = "59.53.63.33"
Inet1.Protocol = 2
Inet1.UserName = "xiaowenwen"
Inet1.PassWord = "xiaowenwen"
Inet1.Execute , "PUT " & App.Path & "\" & Label2.Caption & ".html /wwwroot/msg/" & Label2.Caption & ".html"
Do While Inet1.StillExecuting
DoEvents
Loop
Shell "cmd.exe /k & @echo off & del " & App.Path & "\" & Label2.Caption & ".html"
End Sub
Private Sub Form_Load()
If Val(登录.Text1.Text) = Val(Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/Owner/" & Label2.Caption & ".html")) Then Command2.Visible = True
Open App.Path & "\Login.key" For Input As #1
Do While Not EOF(1)
Line Input #1, Nextline
Label2.Caption = Nextline
频道.Caption = "小文文畅聊 -频道 " & Nextline & " 群主:" & Val(Inet1.OpenURL("http://xiaowenwen.w16.i93133.com/Owner/" & Label2.Caption & ".html"))
Loop
Close #1
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Inet2.OpenURL("http://xiaowenwen.w16.i93133.com/msg/" & Label2.Caption & ".html")
If Val(Label1.Caption) = Val(Label2.Caption) Then
Else
List1.AddItem Label1.Caption
Label2.Caption = Label1.Caption
End If
End Sub
求解收不到的问题,理论上应该是可以的