none
Create and open a directory

    Question

  • I cannot believe how difficult it is to get this answer. I am using vb and my solution is almost ready. I have a directory in my application. that contains necessary information for my project, and that is populated with other user files and reports. I've placed this  directory in my solution area I set my current directory (via a chdir command) to that area. Everything is swell except that I am using a windows path (eg,, c:\...\projects..), and of course that wont work when I deploy to my target website. So0000, how do I set the path?   I am reading a lot of seemingly complicated answers on how to do this, but thus far they have all been beyond my understanding. 

    Anyone????

    eps123


    eps123

    Wednesday, December 30, 2015 8:32 PM

Answers

  • You can get the current working directory using

    Environment.CurrentDirectory

    Append the desired path to it.

    It all Happenz Sendil

    • Marked as answer by eps123 Thursday, December 31, 2015 3:07 PM
    Thursday, December 31, 2015 4:34 AM

All replies

  • You can get the current working directory using

    Environment.CurrentDirectory

    Append the desired path to it.

    It all Happenz Sendil

    • Marked as answer by eps123 Thursday, December 31, 2015 3:07 PM
    Thursday, December 31, 2015 4:34 AM
  • I do appreciate an answer, but perhaps you could help me see the error of my ways.  Line number 5 of the routine fails

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim z As String, by(105) As Byte, B As Object, p As String
            p = "environment.currentdirectory"
            MsgBox(CurDir)
            ChDir(p)
            MsgBox("curdir")
            MsgBox("dir permdb.out")
            FileOpen(22, "test", OpenMode.Output)
            WriteLine(22, "TEST")
            FileClose(22)
            FileOpen(22, "permdb.out", OpenMode.Random, OpenAccess.ReadWrite, OpenShare.LockReadWrite, 105)
            FileGet(22, by, 106)
            For J = 1 To 15
                B = by(J)
                Mid(z, J, 1) = B
            Next
            MsgBox(z)
            FileClose(22)
        End Sub
    End Class
    
    Would love to know what I am missing.

    Thank you.

         


    eps123

    Thursday, December 31, 2015 3:43 PM