if (Attachment != "")
{
string p = System.Environment.CurrentDirectory;
p = p.Replace("\\", @"\");
string path = p + @"\Document\fujian.7z";//文件路径
string password = "prevent";//解压密码
string serverpath = "";
try
{
serverpath = ServerHelper.GetServerPath();
}
catch
{
MessageBox.Show("系统路径查找失败!");
return;
}
string filepath = serverpath;//文件解压路径
string name = Attachment.Replace("/", @"\");//解压后的文件名
try
{
Conris.Utility.SevenZipHelper.ExtractByName(path, filepath, password, name);
}
catch
{
MessageBox.Show("附件查看失败!");
return;
}
string newfilepath = filepath + @"\" + Attachment;
string filename = newfilepath.Substring(0, newfilepath.LastIndexOf('.'));
newfilepath = filename + ".pdf";
if (File.Exists(newfilepath))
{
try
{
webBrowser1.Navigate(newfilepath);
pnFoot.Visible = false;
}
catch
{
MessageBox.Show("附件打开失败,请检查是否已安装Adobe Reader 最新版本。");
return;
}
}
else
pnMiddle.Visible = false;
}