How do I create a folder in VB if it doesn't exist?

后端 未结 12 1339
孤独总比滥情好
孤独总比滥情好 2020-12-23 11:29

I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with a clean install of Windows, wi

12条回答
  •  甜味超标
    2020-12-23 12:08

    Directory.CreateDirectory() should do it. http://msdn.microsoft.com/en-us/library/system.io.directory.createdirectory(VS.71).aspx

    Also, in Vista, you probably cannot write into C: directly unless you run it as an admin, so you might just want to bypass that and create the dir you want in a sub-dir of C: (which i'd say is a good practice to be followed anyways. -- its unbelievable how many people just dump crap onto C:

    Hope that helps.

提交回复
热议问题