5ちゃんねる ★スマホ版★ ■掲示板に戻る■ 全部 1- 最新50  

■ このスレッドは過去ログ倉庫に格納されています

VBscriptについて語りましょう

1 :nobodyさん:02/04/15 17:22 ID:kNVV4hfo
そのうち消え去るかもしれないVBscriptについて
語りましょう。質問もOKです。

127 :Name_Not_Found:04/12/27 22:21:56 ID:BSBqNadW
Option Explicit

Private mObjIE

Main

Public Sub Main()
On Error Resume Next

Dim strUrl, strMes, strRep
Dim objArgs
Dim i

Set objArgs = WScript.Arguments

strUrl = objArgs(0)
strMes = objArgs(1)
strRep = objArgs(2)

'ファイル読み取り
strMes = ReadFile(strMes)

'IEのオブジェクト作成
Set mObjIE = CreateObject("InternetExplorer.Application")

128 :Name_Not_Found:04/12/27 22:22:40 ID:BSBqNadW
OpenIE(strUrl)
DoIE(strMes)
EatCookie(strRep)
CloseIE

'IEのオブジェクトをNothing
Set mObjIE = Nothing

End Sub

129 :Name_Not_Found:04/12/27 22:23:12 ID:BSBqNadW

Private Function ReadFile(strPath)
On Error Resume Next

Dim strMes
Dim FSO
Dim f
Dim fStream

'オブジェクト作成
Set FSO = CreateObject("Scripting.FileSystemObject")
'ストリームオブジェクト作成
Set fStream = FSO.OpenTextFile(strPath)
'文字列取得
strMes = fStream.ReadAll()

ReadFile = strMes

End Function

130 :Name_Not_Found:04/12/27 22:23:52 ID:BSBqNadW

Private Function OpenIE(u)
On Error Resume Next

mObjIE.Height = 50
mObjIE.Width = 100
mObjIE.Visible = True
mObjIE.Navigate u

Do Until mObjIE.Busy = False
WScript.Sleep 2000
Loop

End Function

131 :Name_Not_Found:04/12/27 22:25:03 ID:BSBqNadW
Private Function DoIE(m)
On Error Resume Next

Dim objDoc
Dim objFrm

Set objDoc = mObjIE.Document
Set objFrm = objDoc.Forms(0)

objFrm.MESSAGE.Value = m

Do Until mObjIE.Busy = False
WScript.Sleep 2000
Loop

objFrm.submit.Click

Do Until mObjIE.Busy = False
WScript.Sleep 2000
Loop


Set ObjFrm = Nothing
Set ObjDoc = Nothing

End Function

132 :Name_Not_Found:04/12/27 22:25:39 ID:BSBqNadW
Private Function EatCookie(SearchChar)
On Error Resume Next

Dim objDoc
Dim objFrm
Dim strFrm
Dim c

Set objDoc = mObjIE.Document
Set objFrm = objDoc.Forms(0)
strFrm = objFrm.innerHTML

c = InStr(1, strFrm, SearchChar, 1)

If c > 0 Then
objFrm.submit.Click
End If

Set objFrm = Nothing
Set objDoc = Nothing

End Function

133 :Name_Not_Found:04/12/27 22:26:22 ID:BSBqNadW

Private Function CloseIE
On Error Resume Next

mObjIE.Quit

End Function


134 :Name_Not_Found:04/12/27 22:27:53 ID:BSBqNadW

Main

Public Sub Main()

Dim wshShell
Set wshShell = WScript.CreateObject("WScript.Shell")

Call wshShell.Run("run.vbs ""[URL]"" ""[text file]"" ""承諾""", 0, True)
WScript.Sleep 160000
Call wshShell.Run("run.vbs ""[URL]"" ""[text file]"" ""承諾""", 0, True)
WScript.Sleep 160000
Call wshShell.Run("run.vbs ""[URL]"" ""[text file]"" ""承諾""", 0, True)

Set wshShell = Nothing

End Sub


33 KB
■ このスレッドは過去ログ倉庫に格納されています

★スマホ版★ 掲示板に戻る 全部 前100 次100 最新50

read.cgi ver 05.04.02 2018/11/22 Walang Kapalit ★
FOX ★ DSO(Dynamic Shared Object)