Question:
(VB CODE) How to indicate application directory in visual basic?
sjprince2010
2011-09-15 07:15:28 UTC
I need to make a simple program like this....
When a command buttont clicked, a directory (NewDirectory) will be created on the application directory (where the application is located)
I've tried the following code:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

My.Computer.FileSystem.CreateDirectory(
":\\appDir\NewDirectory")
End Sub

--------------------
But its not working, showing error.
i think something wrong here (":\\appDir\NewDirectory")

Can anyone please tell me how to indicate the application direcory or application path???
Three answers:
?
2016-12-01 06:12:43 UTC
i might say decide for 2010 first, with the aid of fact even with you are able to desire to have a history in VB programming as quickly as you learn VB6, you would be stunned once you progression directly to 2010, as a stable portion of what you discovered from VB6 may be "out of date". (i've got did this in the previous from VB6 to 2008, and the variations got here to me as a super marvel), when you consider which you do no longer use ActiveX controls anymore - all controls and code are controlled by ability of the .internet Framework, between some different issues. And plus, All domicile windows OSes have the .internet Framework put in, so the top person would not could desire to extremely get carry of or set up something greater- different than this technique report/installer for this technique itself (till if the .internet Framework version is older than the single you're working this technique on - VB2008 helps as much as 3.5, and VB2010 is going as much as 4.0), the place with the aid of fact the older VB6 could require using a runtime library that could want for use in the previous working this technique.
Alann
2011-09-15 07:18:48 UTC
Have you tried making use of the deployment options? (Setup options)

There you can select the default installation directory as well as provide option to do Custom installation. It can take care of the rest
Questioner
2011-09-15 07:43:00 UTC
assuming you are using vb.net.



Try:



My.Computer.FileSystem.CreateDirectory( CurDir() & "\" & "NewDirectory")


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...