代码
string strDate = DateTime.Now.ToString("yyyy-MM-dd");
string filename = @file + @"\查询" + DateTime.Now.ToString("yyyy-MM-dd") + ".xlsx";
FileStream fs = new FileStream(@filename, FileMode.Create, FileAccess.ReadWrite);
string aa = "000329923";
//将字符串转换为字节数组
byte[] bytes = Encoding.UTF8.GetBytes(aa);
//向文件中写入字节数组
fs.Write(bytes, 0, bytes.Length);
//刷新缓冲区
fs.Flush();
//关闭流
fs.Close();
结果 字符串少前面几个0
C# FileStream读取字符串少 0

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-07-11
相关资源
相似解决方案