string path = "uploads\\investeducationfiles";
bool folderExists = Directory.Exists(Server.MapPath(path));
if (!folderExists)
Directory.CreateDirectory(Server.MapPath(path));
string path1 = Server.MapPath("uploads\\investeducationfiles\\log.xls");
if (!File.Exists(path1))
{
using (StreamWriter sw = File.CreateText(path1))
{
sw.Write(strattechment.ToString());
}
}
else
{
using (FileStream fs = new FileStream(path1, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write(strattechment.ToString());
}
}
}
bool folderExists = Directory.Exists(Server.MapPath(path));
if (!folderExists)
Directory.CreateDirectory(Server.MapPath(path));
string path1 = Server.MapPath("uploads\\investeducationfiles\\log.xls");
if (!File.Exists(path1))
{
using (StreamWriter sw = File.CreateText(path1))
{
sw.Write(strattechment.ToString());
}
}
else
{
using (FileStream fs = new FileStream(path1, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write(strattechment.ToString());
}
}
}
No comments:
Post a Comment