界面: 声明: textBox1.Text为指定文件路径:string path = @"F:\ABB-pragram\ABB工作站\ABB Station\Systems\SituationalTeaching_Carry\HOME"; textBox2.Text为得到的该指定文件路径的上级路径(通过:提取路径按钮实现) 代码: using System; using System.Collections.Generic; using System.ComponentModel; u
本地路径的创建 在做下载操作时,我们一般先把文件下载到本地指定的路径下,然后再做其他使用. 为了防止程序出现异常,我们通常需要先判断本地是否存在指定的路径. 以C盘Tmp文件夹为例,我们可以这样做,代码如下: if not DirectoryExists('C:\Tmp') then if not CreateDir('C:\Tmp') then raise Exception.Create('Opps, Create New Dir Failed!'); 清空本地指定文件夹下的文件 以C盘Tm