While downloading files from FTP server using WEBClient class, I'm able to download first file (while looping through all the files)to my local system after that i'm getting the error "The remote server returned an error: (530) Not logged in".
The credentials are correct as the first file is getting downloaded successfully
Following is the code
FileInfo fi = new FileInfo(strFileName);
if (!fi.Extension.ToLower().Equals(".csv")) return false;
if (serverUri.Scheme != Uri.UriSchemeFtp)
// Get the object used to communicate with the server.
using (WebClient request = new WebClient())
//request.Proxy = null;
//request.BaseAddress = serverUri.ToString();
// This example assumes the FTP site uses anonymous logon.
string strUsername, strPassword;
strUsername = this.FtpUserName;
strPassword = this.FtpPassword;
request.Credentials = new NetworkCredential(strUsername, strPassword);
string strListeningDir = "";
strListeningDir = this.ListeningDirectory;
I would like to know how to code a server to create an application in C # client / server.
The database used is SQL server, it contains 7 tables.
And more specifically how I can code a server in c # so that multiple users can simultaneously access and complete their treatment (addition, modification, deletion, printing, consulting, research)
I hope to have an answer because it will determine my future work.
Thank you in advance
Thank you for your help, and I would like to know how I can insert my access code to database sql, for example customer identification (login and password in the fields of the table)
Thank you once again
Check out the SqlCommand class, and create a SQL connection using System.Data.SqlClient.SqlConnection class, don't forget to check out this link[^] for information on how to construct a connection string.
Thank you for your help but I know how create a sql connection string but what I don't know is to manage the connection to a sql server database in a client/server application and any necessary treatment.
basically I want to clear the selection and keep a context menu from coming up if the user right clicks in empty space beneath the last row. The MouseDown event fires before the CellMouseDown event so I can't have the latter set a flag to control the former. The former gives a mouse coordinate but I don't see a way to check if it's on a row or not.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
I am quite new to C# and I bumped into this issue and I cannot understand why it is happening. I have a list of objects of class1. class1 has, as a member variable a list of objects of class2, and class2 has as a member variable a list of objiects of class3. In my code I have to add some objects to the list of objects of class3 for the last element of the list of objects of class2 for one of the elements of the list of objects of class1. It seems it should be straight forward but i found a strange behaviour and maybe you clever people can help me make some sense out of it.
I'll explain with an example: if the list of objects of class1 has 2 elements (ListClass1 and ListClass2) and I do