Click here to Skip to main content
15,908,444 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
i want to set id and password on network path in app.conifg is this possible?
XML
like this

<add key="abcpath" value="\\122.324.234\Logs\asdslog" />


What I have tried:

in this can i set id and password?
Posted
Updated 13-May-16 18:48pm
v3

1 solution

Well ... yes, it's possible.
An App.config file can contain anything, so the id and password can be stored in there.

But...storing it is really irrelevant as just storing such data in there doesn't use it automatically to access shares - you will still need to read them out in your app and submit them as Authentication detail when you access the share.

You also need to look at security: App.config is a humanly readable file, so storing passwords in there is a fairly major security risk.
 
Share this answer
 
Comments
super_user 13-May-16 8:36am    
well .. will you please tell me how to store?
OriginalGriff 13-May-16 8:52am    
See here:
http://stackoverflow.com/questions/13043530/what-is-app-config-in-c-net-how-to-use-it
super_user 14-May-16 0:50am    
if i do this
connectionString="Data Source=\\122.324.234\Logs\asdslog;uid=abc; password=123"

then is this right?
OriginalGriff 14-May-16 1:52am    
I have absolutely no idea - it's not a valid IP address, for starters! :laugh:
And it will depend on what your application is going to do with it when it reads it back!
Does that work if you try it in your code without storing it?
super_user 14-May-16 1:57am    
i know this is not valid IP address. i mention rough IP address

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