材料出库单
This commit is contained in:
45
NX.ERP.U8/FileHelp.cs
Normal file
45
NX.ERP.U8/FileHelp.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.U8
|
||||
{
|
||||
public class FileHelp
|
||||
{
|
||||
public static string ReadFile(string strFileName)
|
||||
{
|
||||
if (!File.Exists(strFileName))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
using (StreamReader streamReader = new StreamReader(strFileName, Encoding.Default))
|
||||
{
|
||||
return streamReader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static bool WriteFile(string strContentToFile, string strFilePathName, Encoding encoding)
|
||||
{
|
||||
using (StreamWriter streamWriter = new StreamWriter(strFilePathName, append: false, encoding))
|
||||
{
|
||||
streamWriter.Write(strContentToFile);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static bool WriteFile(string strContentToFile, string strFilePathName)
|
||||
{
|
||||
using (StreamWriter streamWriter = new StreamWriter(strFilePathName, append: false, Encoding.Default))
|
||||
{
|
||||
streamWriter.Write(strContentToFile);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user