using System;
using ;
using ;
using ;
using ;
namespace ftponload
{
class Program
{
static void Main(string[] args)
{
// Method of uploading files
onload("D://");
//How to download files
fload();
}
public static void onload(string file)
{
//Construct a request object for a web server
FtpWebRequest ftp;
//Instantiate a file object
FileInfo f = new FileInfo(file);
ftp = (FtpWebRequest)(new Uri("ftp://192.168.0.150/" + ));
//Create username and password
= new NetworkCredential("123", "123");
= false;
= ;
= true;
= ;
int buffLength = 20480;
byte[] buff = new byte[buffLength];
int contentLen;
try
{
//Get the input stream of the request object
FileStream fs = ();
Stream sw = ();
contentLen = (buff, 0, buffLength);
while (contentLen != 0)
{
(buff, 0, contentLen);
contentLen = (buff, 0, buffLength);
}
();
();
}
catch (Exception e)
{
();
}
}
public static void fload()
{
FtpWebRequest ftp;
ftp = (FtpWebRequest)(new Uri("ftp://192.168.0.6/Connect to the file you specified"));
//Specify username and password
= new NetworkCredential("123", "123456");
WebResponse wr = ();
StreamReader sr = new StreamReader((),);
string s = ();
while((""))
{
s = ();
}
}
}
}