Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

I'm want to access a share folder from my computer to server. But for access a folder from server need to key in the username and password. The below code is shows how could i commend for work it. But the issues is, it cannot function, it shows error

"An exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll but was not handled in user code Additional information: The network path was not found"

I'm already use google and search about it. But i could not find a specific solution for solve it. Please help me. I'm really need yours help...

C#
protected void Button1_Click(object sender, EventArgs e)
        {
            string username = "server";
            string pwrd = "server321";
            {
                Process.Start(@"\\192.168.4.18\" + username + pwrd + "iso documents");
            }
        }
Posted
Comments
Sinisa Hajnal 19-Oct-15 2:40am    
Try process.start(Server.MapPath(String.Format("\\192.168.4.18\{0}{1}iso documents", username, pwrd).

Consider using io.path.combine instead of string concatenation. Also, try to remove hardcoded IP or at least put it in some kind of settings that you can change without recompiling code?
CgKumar 19-Oct-15 3:03am    
Hi, thanks for the code. It still shows the error "Could not find file path specified". This error pop after compile the code. Can you please help me...

1 solution

You should fallow the steps from the next article:
How to Access Network Files using asp.net[^]
 
Share this answer
 
Comments
CgKumar 19-Oct-15 2:44am    
Hi, the link were you give is only for edit the iis. Is that i m need to edit anything in program. It is because after i edit the iis, it still cannot function. Please help me...

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