以下这段vbs文件如何转换成au3文件,谢谢!
以下这段vbs文件如何转换成au3文件,谢谢!Set Isa = CreateObject("FPC.Root")
Set CurArray = Isa.GetContainingArray
Set RuleElements = CurArray.RuleElements
Set DomainNameSets = RuleElements.DomainNameSets
Set DomainNameSet = DomainNameSets.Item("Domains")
Set FileSys = CreateObject("Scripting.FileSystemObject")
Set DomainsFile = FileSys.OpenTextFile("domains.txt", 1)
For i = 1 to DomainNameSet.Count
DomainNameSet.Remove 1
Next
Do While DomainsFile.AtEndOfStream <> True
DomainNameSet.Add DomainsFile.ReadLine
Loop
WScript.Echo "Saving..."
CurArray.Save
WScript.Echo "Done" 突然发现 不知道哪个版本开始 vbs2au3 没有了2au3系列都没了?
下个老版本吧 里面有
要不就学会vbs 手动转了 不知是不是这样(没试):
$Isa = ObjCreate("FPC.Root")
$CurArray = $Isa.GetContainingArray
$RuleElements = $CurArray.RuleElements
$DomainNameSets = $RuleElements.DomainNameSets
$DomainNameSet = $DomainNameSets.Item("Domains")
$FileSys = ObjCreate("Scripting.FileSystemObject")
$DomainsFile = $FileSys.OpenTextFile("domains.txt", 1)
For $i = 1 to $DomainNameSet.Count
$DomainNameSet.Remove 1
Next
While 1
$DomainNameSet.Add $DomainsFile.ReadLine
If $DomainsFile.AtEndOfStream = True Then ExitLoop
Wend
$CurArray.Save
会出错的,可否再帮我改一下,我对vbs 不熟悉
Local $vbs
$vbs &= 'Function Domains()' & @CRLF
$vbs &= 'Set Isa = CreateObject("FPC.Root")' & @CRLF
$vbs &= 'Set CurArray = Isa.GetContainingArray' & @CRLF
$vbs &= 'Set RuleElements = CurArray.RuleElements' & @CRLF
$vbs &= 'Set DomainNameSets = RuleElements.DomainNameSets' & @CRLF
$vbs &= 'Set DomainNameSet = DomainNameSets.Item("Domains")' & @CRLF
$vbs &= 'Set FileSys = CreateObject("Scripting.FileSystemObject")' & @CRLF
$vbs &= 'Set DomainsFile = FileSys.OpenTextFile("domains.txt", 1)' & @CRLF
$vbs &= 'For i = 1 to DomainNameSet.Count' & @CRLF
$vbs &= 'DomainNameSet.Remove 1' & @CRLF
$vbs &= 'Next' & @CRLF
$vbs &= 'Do While DomainsFile.AtEndOfStream <> True' & @CRLF
$vbs &= 'DomainNameSet.Add DomainsFile.ReadLine' & @CRLF
$vbs &= 'Loop' & @CRLF
$vbs &= 'WScript.Echo "Saving..."' & @CRLF
$vbs &= 'CurArray.Save' & @CRLF
$vbs &= 'WScript.Echo "Done"' & @CRLF
$vbs &= 'End Function' & @CRLF
$nVBS = ObjCreate("ScriptControl")
$nVBS.language = "VBScript"
$nVBS.addcode($vbs)
$nDomains = $nVBS.Run("Domains")
嗯 不想转的话 就用ScriptControl对象来直接运行vbs吧 上面那个是实现什么功能 的
页:
[1]