Roman9 Posted May 31, 2009 Posted May 31, 2009 (edited) Hey everyone. I'm writting a proxy checker in autoit and it works flawlessly, except for FileWriteLine (to output working proxies to a text file) Here's a snippet of the code $socket = TCPConnect($ip, $port) Sleep(500) $fault2 = _WSAGetLastError() if @extended Then msgbox (262144,"Fault","WSAGetLastError failed") $fault2 = 'unknown' EndIf If $socket = -1 Then Switch @error Case 1 $fault = "Incorrect IP" Case 2 $fault = "Incorrect port" Case Else $fault = "Valid IP and Port" EndSwitch MsgBox(262144, "Failed to connect","Error = " & $fault2 & @CRLF & $fault) Else FileWriteLine($outputFile, $currentLine & @CRLF) EndIf Is socket ever != -1 I don't get it. :/ Edited May 31, 2009 by Roman9
oMBRa Posted May 31, 2009 Posted May 31, 2009 put a MsgBox in the else statement and see if it gets executed
oMBRa Posted May 31, 2009 Posted May 31, 2009 The MsgBox works check if FileWriteLine return 0, if yes, the error can be either a wrong handle or file name
Roman9 Posted May 31, 2009 Author Posted May 31, 2009 (edited) Thanks for the help oMBRa! After reviewing the help file further, I realized it was the mode I set with FileOpen :/ Changing $outputFile = FileOpen("output.txt", 0) to $outputFile = FileOpen("output.txt", 1) fixed everything Edited May 31, 2009 by Roman9
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now