偶然看到VB.NET版的Save or append text to a file,于是一阵手痒,便有了这C#版的Method:
Save or append text to a file (c#)public static bool SaveTextToFile(string filepath,string text,bool append)
{    
Save or append text to a file (c#)        
using(System.IO.StreamWriter sw=new System.IO.StreamWriter(filepath,append))
{
Save or append text to a file (c#)            
try
{        
Save or append text to a file (c#)                sw.Write(text);
Save or append text to a file (c#)                
return true;
Save or append text to a file (c#)            }

Save or append text to a file (c#)            
catch
{
Save or append text to a file (c#)                
return false;
Save or append text to a file (c#)            }

Save or append text to a file (c#)        }
        
Save or append text to a file (c#)    }

相关文章:

  • 2021-07-31
  • 2021-06-13
  • 2021-11-16
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案