[csharp] #region 創建臨時Temp文件方法 StartFileBuffer
/// <summary>
/// 創建臨時Temp文件方法
/// </summary>
/// <param name="fileName"></param>
private void StartFileBuffer(object fileName)
{
string physicsFilePath = fileName.ToString();
string physicsFilePathTemp = string.Empty;
if (physicsFilePath.IndexOf(".doc") > 0)
{
physicsFilePathTemp = physicsFilePath.Replace(".doc", "Temp.doc");
}
else if (physicsFilePath.IndexOf(".docx") > 0)
{
physicsFilePathTemp = physicsFilePath.Replace(".docx", "Temp.docx");
}
try
{
string targetIP = string.Empty;
string targetLoginName = string.Empty;
string targetPassword = string.Empty;
using (IdentityScope iss = new IdentityScope(targetLoginName, targetIP, targetPassword))
{
//string path = @"\\" + easyWorkCfgString.targetIP + @"\" + easyWorkCfgString.baseFloder;
if (File.Exists(fileName.ToString()))
{
//自己的代碼處理邏輯
}
}
}
catch (Exception e)
{
throw new Exception("創建臨時文件Temp出錯,StartFileBuffer Exception:" + e.Message);
}
}
#endregion