Truong Posted November 26, 2010 Share Posted November 26, 2010 Greetings, I have two questions , and I'm expecting some helps ^^ 1) I've searched and read the forum about WINHTTP.au3, but all the examples are not completed, none of them could work fluently! So I'm asking if you guys could make an example of how to use it, to log in to Auto it forum for instance, or search google. Please maintain the UDF download link you're using 2) I've used the ZIP.au3 UDF. I can successfully create new ZIP file, but when I extract them, it says "Error copying File or Folder - The File Exists" This code is used to make file ZIP. It worked! ;REQUIRE: _ZIP.au3 #include <_zip.au3> #Include <Crypt.au3> $zipPath=@ScriptDir&"\dataTemp.zip"; $desPath=@ScriptDir&"\data"; ;MsgBox(0,"", "Extract "&$zipPath&" to folder "&$desPath); $ss=_Zip_Unzip($zipPath, "bg.jpg", $desPath, 1); ;MsgBox(0,"",$ss); ;MsgBox(0,"",@error); This code is used to extract the ZIP file made above, it does not work :-( ;REQUIRE: _ZIP.au3 #include <_zip.au3> #Include <Crypt.au3> $zipPath=@ScriptDir&"\dataTemp.zip"; $desPath=@ScriptDir&"\data"; ;MsgBox(0,"", "Extract "&$zipPath&" to folder "&$desPath); $ss=_Zip_Unzip($zipPath, "bg.jpg", $desPath, 1); Here is the link of zip.au3 UDF: I also attach all files that I use for the script. Please download and correct it for me! And that's all. Any reply is appreciated!dataCoder.au3Copy of trial.au3_Zip.au3 http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 26, 2010 Moderators Share Posted November 26, 2010 (edited) Truong,I cannot help with the HTTP question, but in respect of the ZIP query - why are you still using torel's UDF? wraithdu has completely rewritten it (as he mentions a couple of posts above yours in the topic ) and his version is much better. Why not try the new UDF which you can find here - you may find it solves your problem. M23Edit: Typnig! Edited November 26, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Truong Posted November 26, 2010 Author Share Posted November 26, 2010 (edited) Hi Melba23, thanks for your advice. I didn't notice that. Now I get it . Oh but wait, when I run the script, it still prompts the same message: "Error copying File or Folder-The File Exists" and return @Error=0 which is not mentioned in the error list >.<! I still have the question above, could anyone please figure it out for me Edited November 26, 2010 by Truong http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
ProgAndy Posted November 26, 2010 Share Posted November 26, 2010 (edited) Hi, the WinHTTP-UDF is here: Homepage: http://winhttp.origo.ethz.ch/wiki/winhttp Thread: In my opinion, there a enough good examples in the download and the helpfile. Edit: Just a quote from Microsoft: A basic understanding of the HTTP protocol is important to use either [WinHTTP or WinInet] interface. Edited November 26, 2010 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Truong Posted November 26, 2010 Author Share Posted November 26, 2010 Hi, the WinHTTP-UDF is here: Homepage: http://winhttp.origo.ethz.ch/wiki/winhttpThread: In my opinion, there a enough good examples in the download and the helpfile.Edit: Just a quote from Microsoft:Thank dude, now I figure it out.How about the ZIP.au3 error? Could anyone solve it for me http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 26, 2010 Moderators Share Posted November 26, 2010 Truong, This code zips both the images you posted and then extracts the .jpg image into a new folder. It uses wraithdu's UDF: #include "zip.au3" $sZipFile = _Zip_Create(@ScriptDir & "\Zipper.zip", 1) ConsoleWrite($sZipFile & @CRLF) If _Zip_AddItem($sZipFile, @ScriptDir & "\bg.jpg", "", 1) = 0 Then ConsoleWrite(@error & @CRLF) Else ConsoleWrite("OK 1" & @CRLF) EndIf If _Zip_AddItem($sZipFile, @ScriptDir & "\transparent.gif", "", 1) = 0 Then ConsoleWrite(@error & @CRLF) Else ConsoleWrite("OK 2" & @CRLF) EndIf If _Zip_Unzip($sZipFile, "pic1.jpg", @ScriptDir & "\Data") = 0 Then ConsoleWrite(@error & @CRLF) Else ConsoleWrite("OK Extract" & @CRLF) EndIf Does it work for you? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Truong Posted November 26, 2010 Author Share Posted November 26, 2010 Truong, This code zips both the images you posted and then extracts the .jpg image into a new folder. It uses wraithdu's UDF: #include "zip.au3" $sZipFile = _Zip_Create(@ScriptDir & "\Zipper.zip", 1) ConsoleWrite($sZipFile & @CRLF) If _Zip_AddItem($sZipFile, @ScriptDir & "\bg.jpg", "", 1) = 0 Then ConsoleWrite(@error & @CRLF) Else ConsoleWrite("OK 1" & @CRLF) EndIf If _Zip_AddItem($sZipFile, @ScriptDir & "\transparent.gif", "", 1) = 0 Then ConsoleWrite(@error & @CRLF) Else ConsoleWrite("OK 2" & @CRLF) EndIf If _Zip_Unzip($sZipFile, "pic1.jpg", @ScriptDir & "\Data") = 0 Then ConsoleWrite(@error & @CRLF) Else ConsoleWrite("OK Extract" & @CRLF) EndIf Does it work for you? M23 It works for the Creating zip file, but then the _Zip_unzip() does not work, just like the original problem! Does it work for you? Ah btw, this question maybe not belong to this topic, I consider it is not an important question to make a new topic so maybe I'll ask here: How can you move the focus from somewhere to the input. For example I have an input $input, and then I HotKeySet("^m","focus") and I want to move the focus to that input:D http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 26, 2010 Moderators Share Posted November 26, 2010 Does it work for you?Of course - or I would not have posted it! Do you have the correct permission to create a file or folder where you are trying to do so? As to the new question, try this: #include <GUIConstantsEx.au3> HotKeySet("^m","_Focus") $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("fred", 10, 10, 200, 20) $hButton = GUICtrlCreateButton("Dummy", 10, 50, 80, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Focus() GUICtrlSetState($hInput, $GUI_FOCUS) EndFunc M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Truong Posted November 26, 2010 Author Share Posted November 26, 2010 Of course - or I would not have posted it! Do you have the correct permission to create a file or folder where you are trying to do so? As to the new question, try this: #include <GUIConstantsEx.au3> HotKeySet("^m","_Focus") $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("fred", 10, 10, 200, 20) $hButton = GUICtrlCreateButton("Dummy", 10, 50, 80, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Focus() GUICtrlSetState($hInput, $GUI_FOCUS) EndFunc M23 Yes the small question is worked thanks to you M23, but the ZIP code still does not work, do you need a short video clip of my screen?? http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Truong Posted November 27, 2010 Author Share Posted November 27, 2010 Here is the video of what happened! http://dl.dropbox.com/u/10790285/OnlineUsed/autoit_proof.avi http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 27, 2010 Moderators Share Posted November 27, 2010 Truong,If you are using this code to read the error, you will not get the value you require as @error will have been reset to the error value of the first MsgBox command - which is almost certainly 0: $ss=_Zip_Unzip($zipPath, "bg.jpg", $desPath, 1); MsgBox(0,"",$ss); MsgBox(0,"",@error);You need something like this:$ss = _Zip_Unzip($zipPath, "bg.jpg", $desPath, 1); $iError = @error MsgBox(0, "", $ss & @CRLF & $ierror);Now what error do you actually get? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Truong Posted November 27, 2010 Author Share Posted November 27, 2010 Now my error is 10: Failed to extract file :-(, what happen to it? Thanks for helping me to figure out the error M23 http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 27, 2010 Moderators Share Posted November 27, 2010 Truong, Are you certain that the paths you are using for the zipfile and the destination are correct? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Truong Posted November 27, 2010 Author Share Posted November 27, 2010 (edited) Truong,Are you certain that the paths you are using for the zipfile and the destination are correct? M23M23,Hi I have attached the files and even give you the video clip of what happen, could you please check it out for me?About the path, I'm 100% sure that I used the full right path @Scriptdir&"\dataTamp.zip"! Edited November 27, 2010 by Truong http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 27, 2010 Moderators Share Posted November 27, 2010 Truong,Hi I have attached the files and even give you the video clip of what happen, could you please check it out for me?I checked out your code and images in post #6 above. When I use your code (slightly adapted for wraithdu's UDF) and your images, I have no problems at all - the images go into the zip and are extracted to a new folder without error. I am afraid I can help no more - I can see no reason why the code I posted above should fail for you. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Truong Posted November 27, 2010 Author Share Posted November 27, 2010 Truong,I checked out your code and images in post #6 above. When I use your code (slightly adapted for wraithdu's UDF) and your images, I have no problems at all - the images go into the zip and are extracted to a new folder without error. I am afraid I can help no more - I can see no reason why the code I posted above should fail for you. M23M23,I very appreciate your help , it's ok, I think that It must be something wrong with my computer. But can I ask for one more favor? Do you know any other way to make multiple files be 1 file, and extract them to files just like winzip, but it does not need to be winzip, any other tricks? http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
ProgAndy Posted November 27, 2010 Share Posted November 27, 2010 You could use 7zip. There is a UDF for the 7zip.dll, so you don't need an extra exe. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Truong Posted November 27, 2010 Author Share Posted November 27, 2010 It's weird that even 7zip udf does not work for me, it always returns value 0! http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
ProgAndy Posted November 27, 2010 Share Posted November 27, 2010 If you have an x64 OS, then you have to make sure you run AutoIt in 32bit (x86) mode since the DLL is not available for 64bit. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Truong Posted November 27, 2010 Author Share Posted November 27, 2010 If you have an x64 OS, then you have to make sure you run AutoIt in 32bit (x86) mode since the DLL is not available for 64bit.I'm using Windows XP :-(, is there any other tricks to combine files to 1 file? That's all I need http://www.facebook.com/xx3004?sk=info Link to comment Share on other sites More sharing options...
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