Jump to content

Chinasmoker

Active Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Chinasmoker

  1. Pubwin is a software ,and it's website :http://www.pubwin.com.cn it's used for NetCafe,eg. check in or check out , manege the Asset ,manege client ... and the Asset manegement function is not work well i work this company ,and i am a customer server,so i got some customer 's complain,they said Asset manegement function has some error,but this software has no switch to close or open this function easily,so i ve a idea ,To write a script ,Send it to customer,then they can resolve this problem by themselves
  2. i wish u could understand Chinese indeed
  3. just because use that as a key to search in google ,then u can find some dangerous info,R u sure that 's correct ? And u , didnt ask me what my script 's used for before u blocked me ,unfair....
  4. Ok.i will self-murder this ID,Restart Scenario
  5. i found a sentence 'abuse public power to retaliate against a personal enemy',who can tell me what it means?
  6. i just wanna know why did u do that ,what 's my fault
  7. i ve a script that needs to modify a file,and this file needs to open as a text , The name of this file is 'systemconfig.properties' follow is this file CODE//\u8d44\u4ea7\u7ba1\u7406\u542f\u52a8\u914d\u7f6e On\u4e3a\u542f\u52a8 Off\u4e3a\u4e0d\u542f\u52a8 AssetOnOff=On SupportES=Off question : i need to modify 'AssetOnOff=On' to'AssetOnOff=Off' ,but i cannt find a suitable function follow my script CODE$reg = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Hintsoft\PubwinServer","basedir");get the path of this file $file = FileOpen ($reg &"\appServ\server\webapps\NetCafe\WEB-INF\classes\systemconfig.properties",0) ;file open $line1 = FileReadLine ($file,2) ;read the line i need $line1_spi= StringSplit($line1,"=");split the string as '=' if $line1_spi[2] = "On" Then $newstrin = StringReplace($line1_spi[2],"On","Off") EndIf
  8. i wrote a script ,but Progress doesnt work,the follow is my script CODE#NoTrayIcon #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $dir #Region ### START Koda GUI section ### Form=E:\wk\au3\setup\Form1.kxf $Form1 = GUICreate("pubwin自动安装程序", 335, 166, 193, 115) GUISetOnEvent($GUI_EVENT_CLOSE,"close") GUISetIcon(@ScriptDir &"\pubwin.ico") $Pic1 = GUICtrlCreatePic(@ScriptDir &"\pubwin.jpg", 0, 0, 324, 60, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $Group1 = GUICtrlCreateGroup("", 0, -8, 329, 73) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label1 = GUICtrlCreateLabel("检测安装所需系统要求:", 8, 136, 136, 17) $Button1 = GUICtrlCreateButton("开始安装", 256, 128, 75, 25, 0) GUICtrlSetOnEvent($Button1,"setup") $Label2 = GUICtrlCreateLabel("安装包路径:", 8, 88, 76, 17) $Input1 = GUICtrlCreateInput("", 80, 80, 185, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Button2 = GUICtrlCreateButton("浏览", 272, 80, 59, 25, 0) GUICtrlSetOnEvent($Button2,"liu") $progressbar1 = GUICtrlCreateProgress(144, 130, 100, 15) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) $Label4 = GUICtrlCreateLabel("注意:安装过程中请不要动键盘和鼠标", 8, 112, 208, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 sleep(1000) WEnd Func liu() $dir = FileSelectFolder("adas","") GUICtrlSetData($Input1,$dir) EndFunc Func setup() ;If $dir <> "" Then For $i = 0 To 100 ;MsgBox(0,"",$i) GUICtrlSetData($progressbar1, $i) Next ;EndIf EndFunc Func close() Exit EndFunc
  9. Hi,all, I ve a trouble, ERROR: IniRead() [built-in] called with wrong number of args. CODE#include <GUIConstants.au3> #include <IE.au3> Opt("GUIOnEventMode", 1) #NoTrayIcon #Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\桌面\Form1.kxf $Form1 = GUICreate("刷流量工具", 482, 354, 193, 115) GUISetOnEvent ($GUI_EVENT_CLOSE,"tc") $Group1 = GUICtrlCreateGroup("设置", 0, 8, 481, 105) $Label1 = GUICtrlCreateLabel("网址:", 16, 40, 40, 17) $Input1 = GUICtrlCreateInput("www.", 56, 40, 185, 21) $Label2 = GUICtrlCreateLabel("间隔时间:", 256, 40, 64, 17) $Input2 = GUICtrlCreateInput("", 320, 40, 33, 21) $Label3 = GUICtrlCreateLabel("秒", 360, 40, 16, 17) $Button1 = GUICtrlCreateButton("保存", 392, 40, 59, 25, 0) GUICtrlSetOnEvent($button1,"save") $Button2 = GUICtrlCreateButton("测试", 72, 80, 75, 25, 0) GUICtrlSetOnEvent($Button2,"test") $Button3 = GUICtrlCreateButton("开刷", 240, 80, 75, 25, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateEdit("", 8, 120, 465, 225) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 sleep(1000) WEnd Func save() $SURL = GUICtrlRead ($Input1) $Stime = GUICtrlRead ($Input2) IniWrite (@ScriptDir &"\IErefresh.ini","URL","URL1",$SURL) IniWrite (@ScriptDir &"\IErefresh.ini","time","time1",$Stime) MsgBox (0,"完成","保存成功") EndFunc Func test() IniRead (@ScriptDir &"\IErefresh.ini","URL","URL1") Sleep(1000) EndFunc Func tc() Exit EndFunc
  10. Func pb() $port = GUICtrlRead($Input1) Select Case $port =0 MsgBox(0,"","你还没输入端口号") Case $port <>0 $pb = Run(@ComSpec & " /c ipseccmd -w REG -p 'port' -r 'port' -f *+0:") & $port & ":tcp -n BLOCK -x";the port is a var EndSelect EndFunc is that all right?
  11. Thanks,I mean that I use script to block port on a pc(not router)
  12. I wanna block some port,eg.1433,but I dont know how to do ,api or wmi ? group policy?
  13. Access database My script can insert a data,but use AddNew error, CODE$dbname = (@DesktopDir & "\db1.mdb") $tblname = "T1" $fldname = "F1" $T = "*" $addfld = ObjCreate("ADODB.Connection") $addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname) $addfld.Execute("Insert Into "& $tblname &"(F1)" &"values('www')") $RS =ObjCreate("ADODB.Recordset") $RS.ActiveConnection = $addfld $RS.Open ("Select "&$T & " From " & $tblname ) $RS.AddNew $RS.Fields(1) = "12345" msgbox(0,"",$RS.Fields(0).Name) msgbox(0,"",$RS.Fields(0).Value) $RS.Update $addfld.Close
  14. Thanks,just according that method,my script still error,and my script's running until go this line of "Addnew"
  15. Maybe this topic 's no connection with au3,but if I cannt solve this trouble,that stand for my script 's no way to be continue,however,I must resolve it ,ok,talking my script,I use "addnew" to modify it ,but reture error the initial value is null below my script: CODE$dbname = (@DesktopDir & "\db1.mdb") $tblname = "T1" $fldname = "F1" $T = "*" _SelectData($dbname, $tblname, $fldname, $T) Func _SelectData($dbname, $tblname, $fldname, $T) $addfld = ObjCreate("ADODB.Connection") $addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname) $RS =ObjCreate("ADODB.Recordset") $RS.ActiveConnection = $addfld $RS.Open ("Select "&$T & " From " & $tblname ) $RS.AddNew $RS.Fields(0).Value = "12345"; $rs.Post msgbox(0,"",$RS.Fields(0).Name) msgbox(0,"",$RS.Fields(0).Value) $addfld.Close EndFunc
  16. I used KD to create a gui interface include a input,and the input has default txt(eg:as a tip to let everyone to know how to fiil this input),while I exec script,I want when someone click any position of this input,the script can auto clean the text in this input,any idea, appreciate!
  17. I will write a script that op database.but I dont know which database au3 can be op,thanks
  18. I got it ,Thanks
  19. I ve used MessageLoop Mode ever before,found it increased CPU load,so I learned oneventmode,and used much func ..endfunc to respond to GUI event ,but I dont understand what the while loop in the middle of the script putted,eg CODE#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("Hello World", 200, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Hello world! How are you?", 30, 10) $okbutton = GUICtrlCreateButton("OK", 70, 50, 60) GUICtrlSetOnEvent($okbutton, "OKButton") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around------this,My question WEnd Func OKButton() ;Note: at this point @GUI_CTRLID would equal $okbutton, ;and @GUI_WINHANDLE would equal $mainwindow MsgBox(0, "GUI Event", "You pressed OK!") EndFunc Func CLOSEClicked() ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE, ;and @GUI_WINHANDLE would equal $mainwindow MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") Exit EndFunc Thanks
  20. I ve patched it ,but the progress bar stayed 0 percent,then auto-closed that window,code: CODEFunc move() $moveR = GUICtrlRead($Input1) $moveD = GUICtrlRead($Input2) $spdir = StringSplit($moveR, "\") $enddir = $spdir[$spdir[0]] ;msgbox(0,"",$spdir[$spdir[0]]) $FileSize = DirGetSize($moveR)/1048576 ProgressOn ("移动进度","已移动") AdlibEnable("_Progress") DirCopy ($moveR,$moveD & "\"&$enddir) ProgressOff() AdlibDisable() EndFunc Func _Progress() Dim $filemoved,$moveD,$enddir,$FileSize $filemoved = Round (DirGetSize($moveD & "\"&$enddir)/1048576,2) $step = Round (($filemoved/$FileSize)*100,2) ProgressSet( $step) EndFunc Thank you
×
×
  • Create New...