动态创建文件夹内的子文件夹 [英] dynamic creation of sub folders within folder

查看:141
本文介绍了动态创建文件夹内的子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要帮助...我需要创建一个动态子文件夹,以在子文件夹中以job_id的名称存储特定的job_id的Excel文件,此处的job_id为标识列.例如,说JON101,JON123等

hi all,

I need help... I need to create a dynamic sub folder to store a particular job_id''s Excel files within the sub folder with job_id''s name, here the job_id is identity column.. say for e.g., JON101, JON123, etc.

sqlcmdsql.Parameters.AddWithValue("@fullFileName", "C:\Bcp\" + Utilities.Jobid + ".xls")



上面的代码用于在公共文件夹中生成Excel文件,现在我需要创建一个sub_folder ...

有人遇到过这个问题吗?请帮助我解决它.



The above code is for generating an Excel file within a common folder, now I need to create a sub_folder...

Has anyone come across this issue? Please help me to resolve it.

推荐答案

看看"system.io.directory"命名空间

基本上,您必须在保存excel文件之前检查该文件夹是否存在,以及是否不创建该文件夹.
Take a look at the ''system.io.directory'' namespace

Basically you''ll have to check if the folder exists and if it doesn''t create it before you save your excel file.


这篇关于动态创建文件夹内的子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆