c# - Cannot connect to FTP Server using a variable credentials -



c# - Cannot connect to FTP Server using a variable credentials -

i'm connecting ftp server error occur saying,

the remote server returned error: (530) not logged in.

webclient request = new webclient(); request.credentials = new networkcredential(username.normalize(), password.normalize()); byte[] filedata = request.downloaddata("ftp://" + ftpaddress + "/" + folder + "/" + folderday + "/" + file); filestream downloadfile = file.create("c:\\folder\\downloadedfiles" + "\\" + file); downloadfile.write(filedata, 0, filedata.length); downloadfile.close();

ftpaddress server ip / address username user name password password

i created variables represent path, , credentials. didn't work. error above appears.

but when way:

request.credentials = new networkcredential("admin", "h2scs2014");

it work. what's wrong? help me out please.

c# ftp

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -