Tukata Posted December 5, 2006 Posted December 5, 2006 Hi, It seems that using "InetGetSize" when not connected, it will open the dialer. But if I "Cancel" the dialer the script continue trying and does not exit. How can I Exit if user click "Cancel" on the dialer ? Here is my script and I will appreciate any improvement you can suggest: if $CmdLine[0] > 0 Then $a = $CmdLine[1]; Full path to file on the web Else Exit EndIf $Size=InetGetSize ($a) If $Size = 0 Then MsgBox(48, "Error", "Error has occurred. Connection could not be established.", 3) EXIT EndIf MsgBox(4096, "Download", "Starting download now..." & $Size & " kb", 3) $File= StringTrimLeft($a, 34); Extract file name and extension $Name= StringTrimRight($File, 4); Extract file name only $File=@ScriptDir & "\Folder\" & $File InetGet($a, $File, 1, 1) While @InetGetActive TrayTip($Size,@InetGetBytesRead, 10, 16) Sleep(250) Wend Thank you Tuk
/dev/null Posted December 5, 2006 Posted December 5, 2006 Hi,It seems that using "InetGetSize" when not connected, it will open the dialer. But if I "Cancel" the dialer the script continue trying and does not exit. How can I Exit if user click "Cancel" on the dialer ?Here is my script and I will appreciate any improvement you can suggest:there are two ways to solve your problem.1.) Change your IE setting to NOT dial any RAS connections2.) Check if there is an internet connection (e.g. by using ping www.google.com or something else) and only call InetGetSize when you detect an internet connection. There are some "connection checking" scripts available on the forum. Use the search function of the forum.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Tukata Posted December 5, 2006 Author Posted December 5, 2006 Thanks. I found this line of code on the forum which solved my problem. One question about this code - will it work for all OS ? $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) Thank you Tuk
JSThePatriot Posted December 5, 2006 Posted December 5, 2006 (edited) It will work on the following systems.Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me, Windows 98, or Windows 95I hope that answers your question.JS Edited December 5, 2006 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Tukata Posted December 5, 2006 Author Posted December 5, 2006 (edited) It will work on the following systems.I hope that answers your question.JSThanks . Edited December 5, 2006 by Tukata
Valik Posted December 6, 2006 Posted December 6, 2006 It will work on the following systems.I hope that answers your question.JSThat's actually not true. The operating system has nothing to do with the Inet functions. What's important is the version of Internet Explorer. The function in question requires Internet Explorer 4.0 or later.
Tukata Posted December 6, 2006 Author Posted December 6, 2006 Valik Thank you. What about other browsers ? Tuk
JSThePatriot Posted December 6, 2006 Posted December 6, 2006 That's actually not true. The operating system has nothing to do with the Inet functions. What's important is the version of Internet Explorer. The function in question requires Internet Explorer 4.0 or later.The page I saw on MSDN said it worked on all those versions of windows. A bit further down it said that IE 4.0 or later is required. That is why I posted what I did. I do appreciate the extra info as I didn't read that far down until you brought it to my attention.http://msdn.microsoft.com/library/default....nectedstate.aspJS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Valik Posted December 6, 2006 Posted December 6, 2006 ValikThank you.What about other browsers ?TukWhat do you mean "what about other browsers"?
Tukata Posted December 6, 2006 Author Posted December 6, 2006 (edited) What do you mean "what about other browsers"?You said "IE 4.0 or later is required". What do you mean IE ? - Internet Exploere ?I mean not IE brwosers.Tuk Edited December 6, 2006 by Tukata
Valik Posted December 6, 2006 Posted December 6, 2006 Actually, I explicitly said "Internet Explorer 4.0 or later". Anyway, I still don't understand what you are asking. The function requires Internet Explorer 4.0 or later to be installed on the system. Other browsers are irrelevant and I don't know why you are asking anything. I told you what the requirement was for the function.
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