 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ahklerner
Joined: 26 Jun 2006 Posts: 1381 Location: USA
|
Posted: Tue Apr 08, 2008 4:27 am Post subject: MiniFTP [a mini FTP client made in ahk] |
|
|
THE SOURCE CODE: http://autohotkey.net/~nkruzan/MiniFTP3.zip
License
| Code: |
/* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The **** You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details. */
|
Thanks to Olfen, Maj, Titan, Adde_P, DerRaphael, Sean and anyone else I may have used code from. I will try to put more credits in the source later.
Comments, Bugs, Suggestions welcome. Feel free to make your own changes and modify it to your hearts content.
 _________________
ʞɔпɟ əɥʇ ʇɐɥʍ
Last edited by ahklerner on Wed Apr 09, 2008 7:15 pm; edited 1 time in total |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1381 Location: USA
|
Posted: Tue Apr 08, 2008 6:58 pm Post subject: |
|
|
Added license to first post _________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
widow Guest
|
Posted: Wed Apr 09, 2008 3:12 am Post subject: |
|
|
It works
Awesome ahk work. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Apr 09, 2008 3:15 am Post subject: |
|
|
i wonder whats the difference between this and the others  |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Thu Jul 17, 2008 10:49 pm Post subject: |
|
|
you have once again earned my profound respect _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Jul 18, 2008 4:19 am Post subject: Re: MiniFTP [a mini FTP client made in ahk] |
|
|
...BEST...LICENSE...EVER!...I of course normally don't read or care about licenses...but when I hovered on it & saw "wtfpl" in the url...I HAD to click!... |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Tue Mar 16, 2010 2:54 pm Post subject: |
|
|
I tried adding more info headers to the listview.
I'm having issues with getting the correct date from files (FileTimeToLocalFileTime and FileTimeToSystemTime).
Like you can see, the timestamps it returns are complete gibberish.
I tried adapting the code from the following postings:
- SKAN's ProcessCreationTime function
- FileGetTime with milliseconds
- The different attempts at DllCall: Basic FTP Functions
The minor changes I made to MiniClient.ahk to add the extra headers:
| Code: | line 83:
Gui, 1:Add, ListView, x170 y%yOffset% w480 h200 gFileSelect AltSubmit vMiniFTP_ServerList hwndMiniFTP_hFileList -TabStop, Name | Size | Attrib | Path | Creation Time | Last access time | Last write time
line 356:
LV_Add("",GetItem(pFiles, ThisSelection . "_" . A_Index . "_Name"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_Size") . " " . GetItem(pFiles, ThisSelection . "_" . A_Index . "_SizeType"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_Attrib"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_Path"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_CreationTime"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_LastAccessTime"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_LastWriteTime"))
|
Different attempts at changing/adapting the FileTimeToStr function in FTP.ahk (none of which seem to work)
| Code: | /*
FileTimeToStr(FileTime) {
VarSetCapacity(SystemTime, 16, 0)
DllCall("FileTimeToSystemTime", "uint", &FileTime, "uint", &SystemTime)
Return NumGet(SystemTime,2,"short")
. "/" . NumGet(SystemTime,6,"short")
. "/" . NumGet(SystemTime,0,"short")
. " " . NumGet(SystemTime,8,"short")
. ":" . NumGet(SystemTime,10,"short")
. ":" . NumGet(SystemTime,12,"short")
. "." . NumGet(SystemTime,14,"short")
}
*/
/*
; FileTimeToSystemTime: http://msdn2.microsoft.com/en-us/library/ms724280.aspx
;~ typedef struct _SYSTEMTIME {
;~ WORD wYear;
;~ WORD wMonth;
;~ WORD wDayOfWeek;
;~ WORD wDay;
;~ WORD wHour;
;~ WORD wMinute;
;~ WORD wSecond;
;~ WORD wMilliseconds;
;~ } SYSTEMTIME;
FileTimeToStr(ByRef @FileTime)
{
VarSetCapacity(SystemTime, 16, 0)
DllCall("FileTimeToLocalFileTime", "uint", &@FileTime, "uint", &@FileTime)
DllCall("FileTimeToSystemTime", "uint", &@FileTime, "uint", &SystemTime)
str .= NumGet(SystemTime, 0, "ushort")
str .= StrLen(Word := NumGet(SystemTime, 2,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 6,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 8,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 10,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 12,"ushort")) == 1 ? ("0" . Word) : Word
return str
}
*/
/*
FileTimeToStr(FileTime) {
DllCall( "FileTimeToLocalFileTime", Int64P,FileTime, Int64P,Local ), AT := 1601
AT += % Local//10000000, S
Return AT
}
*/
;/*
; FileTimeToSystemTime: http://msdn2.microsoft.com/en-us/library/ms724280.aspx
;~ typedef struct _SYSTEMTIME {
;~ WORD wYear;
;~ WORD wMonth;
;~ WORD wDayOfWeek;
;~ WORD wDay;
;~ WORD wHour;
;~ WORD wMinute;
;~ WORD wSecond;
;~ WORD wMilliseconds;
;~ } SYSTEMTIME;
FileTimeToStr(ByRef @FileTime)
{
VarSetCapacity(SystemTime, 16, 0)
DllCall("FileTimeToLocalFileTime", "uint", &@FileTime, "uint", &@FileTime)
DllCall("FileTimeToSystemTime", "uint", &@FileTime, "uint", &SystemTime)
;/*
str .= NumGet(SystemTime, 0, "ushort")
str .= StrLen(Word := NumGet(SystemTime, 2,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 6,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 8,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 10,"ushort")) == 1 ? ("0" . Word) : Word
str .= StrLen(Word := NumGet(SystemTime, 12,"ushort")) == 1 ? ("0" . Word) : Word
return str
;*/
Loop 16 { ; Extracting and concatenating 8 words from a SYSTEMTIME structure
Word := Mod(A_Index-1,2) ? "" : *( &SystemTime +A_Index-1 ) + ( *(&SystemTime +A_Index) << 8 )
Time .= StrLen(Word) = 1 ? ( "0" . Word ) : Word ; Prefixing "0" for single digits
}
Return SubStr(Time,1,6) . SubStr(Time,9,8) ; YYYYMMDD24MISS
}
;*/
/*
FileTimeToStr( File, Mode="M" ) { ; Topic: www.autohotkey.com/forum/viewtopic.php?t=49194
;If ( VarSetCapacity($,342,0) && ( H:=DllCall( "FindFirstFile", Str,File, UInt,&$ ) ) ) {
;DllCall( "FindClose", UInt,H )
VC:=&$+4, VA:=&$+12, VM:=&$+20, FT:=V%Mode%
LFT:=&$+318 , DllCall( "FileTimeToLocalFileTime", UInt,FT, UInt,LFT )
ST:=LFT+8 , DllCall( "FileTimeToSystemTime", UInt,LFT, UInt,ST )
Loop 7
T .= StrLen( N:=NumGet(ST+0,(A_Index-1)*2,"UShort") ) < 2 ? "0" N : N
Return SubStr(T,1,6) . SubStr(T,9,8) . SubStr( "00" NumGet( ST+0,14,"UShort" ), -2 )
}
*/ |
Anybody?  |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4634 Location: AHK Forum
|
Posted: Wed Jul 21, 2010 8:31 pm Post subject: |
|
|
You will need to use InternetTimeToSystemTime
Example (requires AHK_H) and WinDlls() | Code: | _:=WinDlls("wininet.dll")
fdata:=Struct("WIN32_FIND_DATA")
time:=Struct("SYSTEMTIME")
ftp:=_.InternetConnect(int:=_.InternetOpen(A_ScriptName,1),"ftp.autohotkey.net",21,"HotKeyIt","MyPassword",1)
_.FtpFindFirstFile(ftp,"AutoHotkey.zip",fdata[""])
_.InternetTimeToSystemTime(fdata.ftCreationTime[""],time[""])
MsgBox % time.wYear . "-" time.wMonth . "-" time.wDay
. "`n" time.wDayOfWeek
. "`n" time.wHour . ":" time.wMinute . ":" time.wSecond . ":" time.Milliseconds
_.InternetCloseHandle(ftp),_.InternetCloseHandle(int) |
EDIT: changed WinDlls and removed StrGet in InternetTimeToSystemTime _________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
bell-e
Joined: 09 May 2011 Posts: 5 Location: Palmdale
|
Posted: Fri May 13, 2011 7:34 am Post subject: |
|
|
| I love autohotkey and made some small scripts already for working faster in windows. Can I use this script with my web host too? I'm relative new to the whole webbing thing and I don't wanna pay for a ftp program. |
|
| Back to top |
|
 |
sumon
Joined: 18 May 2010 Posts: 1011 Location: Sweden
|
Posted: Fri May 13, 2011 10:36 am Post subject: |
|
|
| bell-e wrote: | | I love autohotkey and made some small scripts already for working faster in windows. Can I use this script with my web host too? I'm relative new to the whole webbing thing and I don't wanna pay for a ftp program. |
If your webhost supports FTP access (which most do, since you need a way to put files there...), you can use this program or any other FTP program to connect to your webhost space, of course
As for paying, I use FileZilla which is also free. But you can probably use this script too (I haven't tried it) |
|
| Back to top |
|
 |
specter333
Joined: 15 Jan 2007 Posts: 526
|
Posted: Tue May 17, 2011 5:50 pm Post subject: |
|
|
This is an amazing project. I was going to search the forums for FTP information the other day but when I looked at the Scripts & Functions page this was at the top.
One thing I need to be able to do that I haven't figured out is when connecting I need to start in a specific folder, not the root folder which is selected during log in. Is there a way to do that when logging in?
For example when logging into AHK.net it starts in this folder,
| Code: | | autohotkey.net/xfm/list/ |
and I need to start in this folder.
| Code: | | autohotkey.net/xfm/list/?d=StartFolder |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|