Does anybody know how to create a new folder with arcobjects? This is what I want to do: insert a text in a TextBox and, when I run the aplication, it will create a folder with the name wroten in the TextBox.

Thanks, Alex


I'm not sure about using ArcObjects but you can use VB.NET, see below.

Dim value as string
textbox1.text = value

    If (Not System.IO.Directory.Exists("C:\" & value)) Then
                    System.IO.Directory.CreateDirectory("C:\" & value)                
End If
| improve this answer | |
  • It was more simple that I thought: – Alex Aug 1 '11 at 13:40
  • It was more simple that I thought: Dim path As String Cnc = UCase(TextBox1) path = "c:\temp\teste\" & Cnc MkDir path Thanks anyway – Alex Aug 1 '11 at 13:41
  • 2
    BTW, for the non-simple (arcobjects) way, I suppose you could use IGxFile.New after setting IGxFile.Path on the GxFolder coclass. – Kirk Kuykendall Aug 1 '11 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.