Sign in to follow this  
Followers 0
AngelTouch

Qustion : FTp get id and pass

9 posts in this topic

hello every one

before i posted here i searched alot to fined solution to my question but couldn't

fined any thing that helps me

so i wish you could help me

$file = FileGetSize ($file0)
        $server = "ftp.members" 
        $username = "user"
        $pass = "pass" 
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, "D:\Program Files\TinaSoft\Easy Cafe Server\database\maindbex.DB", @HOUR &@MIN & @SEC )
        $Ftpc = _FTPClose($Open)

$file2 = FileGetSize ($file0)
        $server = "ftp.members" 
        $username = "user"
        $pass = "pass" 
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, "D:\Program Files\TinaSoft\Easy Cafe Server\database\maindbex.DB", @HOUR &@MIN & @SEC )
        $Ftpc = _FTPClose($Open)

exit

it works fine and sends me 2 copies of DB to my ftp

now my problem is that i want the second ftp get $server\$username\$pass from text (c:\id.txt)

Share this post


Link to post
Share on other sites



Your code will be something like this psuedo code:

$data = FileRead from C:\id.txt
$split = StringSplit $data so you get the elements you want in an array
$server = $split[...]
$username = $split[...]
$client = $split[...]

With the help file in one hand, this example in the other, and your script in the other ;) you will get the task done.

Share this post


Link to post
Share on other sites

Your code will be something like this psuedo code:

$data = FileRead from C:\id.txt
$split = StringSplit $data so you get the elements you want in an array
$server = $split[...]
$username = $split[...]
$client = $split[...]

With the help file in one hand, this example in the other, and your script in the other ;) you will get the task done.

So your saying he has 3x hands?

:evil:

Share this post


Link to post
Share on other sites

Every good programmer has three hands, that's how they get their job done in time.

It's not surprising so many projects are over budget and late.

Share this post


Link to post
Share on other sites

i know that I'm supposed now to make it work

but I'm afraid i can't ....

plz could u make it in an easier way

c:\id.txt have 3 lines

ftp.member.online.com

angeltears

password

i need it to be simple or something like this

$file = FileGetSize ($file0)
    $server = FileReadLine("id.txt", 1)
        $username =FileReadLine("id.txt", 2)
        $pass = FileReadLine("id.txt", 3)
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, "D:\Program Files\TinaSoft\Easy Cafe Server\database\maindbex.DB", @HOUR &@MIN & @SEC &@ComputerName )
        $Ftpc = _FTPClose($Open)

pregnancy is so hard and i have to stay home when I'm tired i want to manage work while I'm in bed

Share this post


Link to post
Share on other sites

Your code will be something like this psuedo code:

[ code='text' ] ( Popup )

$data = FileRead from C:\id.txt $split = StringSplit $data so you get the elements you want in an array $server = $split[...] $username = $split[...] $client = $split[...]

With the help file in one hand, this example in the other, and your script in the other ;) you will get the task done.

or could u make it in real example cz i couldn't make splits to work

i don't know what I'm doing wrong

c:\id.txt have 3 lines
ftp.member.online.com
angeltears
password

Share this post


Link to post
Share on other sites

or could u make it in real example cz i couldn't make splits to work

i don't know what I'm doing wrong

c:\id.txt have 3 lines
ftp.member.online.com
angeltears
password

Here is the code you need:

$txtfile = FileOpen ( "C:\id.txt", 0 )
        $server = FileReadLine($txtfile, 1)
        $username = FileReadLine($txtfile, 2)
        $pass = FileReadLine($txtfile, 3)
        FileClose($txtfile)
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, "D:\Program Files\TinaSoft\Easy Cafe Server\database\maindbex.DB", @HOUR &@MIN & @SEC )
        $Ftpc = _FTPClose($Open)

I hope this helps, if you need anything with a GUI i will be more than happy to make you a much more advanced program since i enjoy coding in AutoIt.

Share this post


Link to post
Share on other sites

Thanx a lot it worked 100% ur grate ;)

and thanx for all who helped

:evil:

Share this post


Link to post
Share on other sites

No problem ;)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0