Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string ftpconnect(string serveradress, string serverfolder, string username, string password)
- {
- try
- {
- FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(serveradress + "/hei.txt");
- request.Method = WebRequestMethods.Ftp.UploadFile;
- request.Credentials = new NetworkCredential(username, password);
- request.UsePassive = true;
- request.UseBinary = true;
- request.KeepAlive = true;
- string response = request.GetResponse().ToString();
- return "FTP Connection established!";
- }
- catch (Exception e)
- {
- return e.Message;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement