我在本机运行的时候,中间一个功能是创建html文件,可以创建,
但是局域网访问我发布的这个网站的时候却不能创建到我那台电脑上的指定文件夹下,
其中,我该设置的权限已经全部都设置为 完全控制,实在是不知道怎么办了
请哪位高人指点一下,如果有可以解决的高人,顺便加我QQ,实在是太急了!!
我QQ 是 564050758
但是局域网访问我发布的这个网站的时候却不能创建到我那台电脑上的指定文件夹下,
其中,我该设置的权限已经全部都设置为 完全控制,实在是不知道怎么办了
请哪位高人指点一下,如果有可以解决的高人,顺便加我QQ,实在是太急了!!
我QQ 是 564050758
这位兄弟,lz只是通过语言描述,并没有什么错误贴出,你怎么就能断定是缺少network service?
private string CreateHtml(int ccid,string strTitle, string content)
{
string ccidStr = ccid.ToString();
string strFileName = ccidStr + ".html";//存储到数据库中
try
{
StringBuilder strhtml = new StringBuilder(); //创建StreamReader对象
using (StreamReader sr = new StreamReader(Server.MapPath("../" + "HtmlPage/") + "Template.htm", Encoding.GetEncoding("gb2312")))
{
String oneline;
//读取指定的HTML文件模板
while ((oneline = sr.ReadLine()) != null)
{
strhtml.Append(oneline);
}
sr.Close();
}
//这三个是用来替换的。
string FilePath = "";
strhtml = strhtml.Replace("$Title", strTitle);
strhtml = strhtml.Replace("$Content", content);
FilePath = Server.MapPath("../") + "HtmlPage" + "/" + ccidStr + ".html";
//Response.Write(FilePath);
//Response.End();
//创建文件信息对象--------------------------------------------
FileInfo finfo = new FileInfo(FilePath);
//以打开或者写入的形式创建文件流
using (FileStream fs = finfo.OpenWrite())
{
//根据上面创建的文件流创建写数据流
StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.Default);
//把新的内容写到创建的HTML页面中
sw.WriteLine(strhtml);
sw.Flush();
sw.Close();
}
}
catch (Exception err)
{
//输出异常信息
Response.Write(err.ToString());
}
return ccidStr;
}
ccid是传进去的一个标题ID,只是为了创建文件时的名字
title 是这个标题的内容
content是这个标题的教材信息
请问,有没有可能是,发布了网站后,这个里面的一些路径也要做相对的改动呢?
{
//输出异常信息
ccidStr = err.ToString();
}
-____-!!
公司把QQ和MSN都封了,上不去~
你在百度或者 goole上打 webqq 里面有个可以跟QQ一样的
加我Q,我跟你细说!