[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Visual Studio 2008 - create directory if does not exist

Posted on 2011-09-21
4
Medium Priority
?
229 Views
Last Modified: 2012-05-12
The project is written in Visual Basic 2008.  I have code that writes a text file to c:\TempStorage
What code would be needed to verify the c:\TempStorage directory exists, and if it does not exist, what code would be needed to create the folder c:\tempStorage?
0
Comment
Question by:dastaub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
QPR earned 1600 total points
ID: 36578267
If Not Directory.Exists(path) Then
    Directory.CreateDirectory(path)
End If
0
 
LVL 25

Assisted Solution

by:Luis Pérez
Luis Pérez earned 400 total points
ID: 36578755
But for the QPR code to work, don't forget to add:

Imports System.IO

Hope that helps.
0
 
LVL 29

Expert Comment

by:QPR
ID: 36578897
True but if they already have code writing to a file then it's a safe assumption they are already importing system.io
0
 

Author Comment

by:dastaub
ID: 36581448
I was actually using:
myXML.Save("c:\EPDEHRS\XML\PQRI_" & txtNumber.Text & ".xml")
so
the data of adding "Imports System.IO" was also of value

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question