本文介绍了我如何删除目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在窗体结尾处删除目录而不会出现错误.
How can i delete directory at the closing of form without error.
推荐答案
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
string strPath = "C:\\Temp\\Test";
if (Directory.Exists(strPath))
Directory.Delete(strPath);
}
这篇关于我如何删除目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!