Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //To Connect to ftp
- private bool TryConnect()
- {
- bool ret = false;
- try {
- FTP = new FTPConnection();
- FTP.ServerAddress = "192.108.1.10";//Server IP address
- FTP.UserName = "username";//server user name
- FTP.Password = "******";//Password
- FTP.ConnectMode = FTPConnectMode.PASV;
- FTP.Connect();
- ret = FTP.IsConnected;
- } catch (Exception ex) {
- }
- return ret;
- }
- //To Send File
- if (TryConnect())
- {
- FTP.UploadFile("Directory", "File Name", false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement