Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How do you create a folder with a random name using Path.GetRandomFileName in temp using Path.GetTempPath?

What I have tried:

Research, but the codes don't let me do what I want.
Posted
Updated 16-Jul-17 20:42pm

1 solution

VB
Imports System.IO

Dim temp as String = "C:\temp"
Dim folderName as String = Path.GetRandomFileName()
Dim combination As String = Path.Combine(temp, folderName)
Directory.CreateDirectory(combination)
 
Share this answer
 
v3
Comments
[no name] 17-Jul-17 5:50am    
It says "temp is not declared"? Please help? I have "Imports System.IO"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900