Click here to Skip to main content
15,908,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I have file server which include my txt files.

I tried to c# program to access it but i cant access.Because it need loginname and password.

How can i enter this login infos in c#?

What I have tried:

google search
try some code sample
Posted
Updated 24-Jul-17 7:00am

1 solution

Quote:
Because it need loginname and password.
That means it requires you to pass the authentication information, so that server knows who is trying to access the service. You should pass this information to servers, it's not just your server, but every server requires this authentication model, for security, quota or any other purposes.

Typically, this is provided in the documentation of your server, the server shows the endpoints where you connect and also the headers which you require to pass (username and password). In .NET framework's networking you use NetworkCredential[^] object to pass the information about authentication.

Have a look at this tip, it explains the concept of sending the username and password (a different implementation, of course) so give it a look, Simple C# FTP Class[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900