asp.net c# 帮我把 这个读取word 的程序代码具体解释一下 不懂啊

private string ReadDoc()
{
string guid=Guid.NewGuid().ToString();
string sys_Path = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + myCollection.SelectedValue.Replace("/", "\\");
Aspose.Words.Document doc = new Aspose.Words.Document(sys_Path);
string p=Path.Combine(Request.PhysicalApplicationPath, "thesises\\")+guid+".html";
doc.Save(p, Aspose.Words.SaveFormat.Html);
string s= Reader(p);
Match mc = Regex.Match(s, @"<body>[\s\S]*?<\/body>", RegexOptions.IgnoreCase);
Delete(p);
return mc.Groups[0].Value;
}

创建Aspose.Words.Document doc = new Aspose.Words.Document(sys_Path); word文档
string p=Path.Combine(Request.PhysicalApplicationPath, "thesises\\")+guid+".html";
转换html
doc.Save(p, Aspose.Words.SaveFormat.Html);
保存html
string s= Reader(p);替换数据

Match mc = Regex.Match(s, @"<body>[\s\S]*?<\/body>", RegexOptions.IgnoreCase);
用正则表达式匹配数据
Delete(p);
删除数据
mc.Groups[0].Value
返回匹配到的第一个值
温馨提示:答案为网友推荐,仅供参考
相似回答