Click here to Skip to main content
16,012,843 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public partial class About : System.Web.UI.Page
{
    public string newcontnt = "";
    public string oldcontent = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        newcontnt = Request.QueryString["newcon"];
        oldcontent = Request.QueryString["oldcon"];

        writetofile(newcontnt, oldcontent);
    }

    private void writetofile(string newcontnt, string oldcontent)
    {

        string text = File.ReadAllText(@"\\192.168.7.103\testdata.txt");
        string textn = newcontnt;
        string texto = oldcontent;
        text = text.Replace(texto, textn);
        File.WriteAllText(@"\\192.168.7.101\testdata.txt", text);
        Response.Redirect("http://localhost/test61.html");

    }
}
in this code its showing network name not found error
Posted
Comments
Is that directory/folder shared with the network, where file is residing ?
kiran gowda8 15-Apr-15 4:00am    
no its not shared
Please share that and try.
kiran gowda8 15-Apr-15 5:24am    
done. but now its showing network path was not found
Ideally the path should be like...

\\IP\SharedFolderPath\FileName

1 solution

Ideally the path should be like...

\\IP\SharedFolderPath\FileName
 
Share this answer
 

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