Asp.Net How to write Css File or File Write in Asp.Net

StreamWriter sw = File.CreateText(Server.MapPath(@”css\admin.css”));
sw.Write(txtCSS.Text);
File.WriteAllText(Server.MapPath(@”css\temp.css”), txtCSS.Text);
sw.Close();

string sSource = Server.MapPath(@”css\temp.css”);
string sExepath = Server.MapPath(@”css\admin.css”);

// Copy the file.
File.Copy(sSource, sExepath, true);

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s