Create file (specify path)

From , 4 Years ago, written in C#, viewed 53 times.
URL https://pastebin.vip/view/1bf0c592
  1. /// <summary>
  2. /// 指定路径创建文件
  3. /// </summary>
  4. /// <param name="strPath">路径</param>
  5. public void createMyFile ( string strPath )
  6. {
  7.         FileStream fs = File.Create ( strPath );
  8.         MessageBox.Show ( "创建成功!" );
  9.         fs.Close();    //通过文件流来创建,在创建完毕后要记住关闭文件流
  10.         //获取此文件的相关属性
  11.         labResult.Text = "此文件的相关属性如下:\n";
  12.         labResult.Text += File.GetCreationTime ( strPath ); //创建时间
  13. }
  14.  

Reply to "Create file (specify path)"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website