/// <summary> |
/// 指定路径创建文件 |
/// </summary> |
/// <param name="strPath">路径</param> |
public void createMyFile ( string strPath ) |
{ |
FileStream fs = File.Create ( strPath ); |
MessageBox.Show ( "创建成功!" ); |
fs.Close(); //通过文件流来创建,在创建完毕后要记住关闭文件流 |
//获取此文件的相关属性 |
labResult.Text = "此文件的相关属性如下:\n" ; |
labResult.Text += File.GetCreationTime ( strPath ); //创建时间 |
} |
by: 发表于:2018-02-02 09:54:37 顶(0) | 踩(0) 回复
??
回复评论