#region 将二进制转化为文件 public static string ConvertByteToFile(object objData, string filePathName) { //string fileName = ""; //fileName = new PublicConst().PathTempFile + fileName; string folder = System.IO.Path.GetDirectoryName(filePathName); if (!System.IO.Directory.Exists(folder)) { System.IO.Directory.CreateDirectory(folder); } if (System.IO.File.Exists(filePathName)) { try { System.IO.File.Delete(filePathName); } catch { //("FileInUse"); return ""; } } System.IO.FileStream fs = new System.IO.FileStream(filePathName, System.IO.FileMode.Create, System.IO.FileAccess.Write); System.IO.BinaryWriter w = new System.IO.BinaryWriter(fs); try { w.Write(objData as byte[]); } catch (Exception) { } finally { w.Close(); fs.Close(); } return filePathName; } #endregion #region 将二进制转化为文件 public static string C 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交