C# 自动打开文件(rar/pdf)
C# 自动打开文件(rar/pdf)C# Code:var tmpFolder = System.Environment.GetEnvironmentVariable("TMP");
var file = Path.Combine(tmpFolder, obj.FileName);
File.WriteAllBytes(file, obj.FileBody);
if (File.Exists(file))
{
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = file;
process.StartInfo.Verb = "Open";
process.StartInfo.CreateNoWindow = true;
process.Start();
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
扫一扫加作者微信