Error: empty path name is not legal


  • Public Function serialize_get(ByVal inpath As String) As Object
            Dim myobj As Object
            Dim s As Stream = New FileStream(inpath, FileMode.Open)
            Dim b As binaryformatter = New binaryformatter()
            myobj = b.Deserialize(s)
            Return myobj
        End Function

    while debuggin i keep getting that error at the bold line.  how do i know what path the application is trying to save the information too

    Mittwoch, 6. Mai 2009 16:02


  • The exception states the exact problem.

    The variable inpath has not been assigned a value, its value is "".

    Familiarise youself with the Debugger. Place a breakpoint at the associated bolded line and hover over the inpath variable.

    This should provide the answer.
    MCTS. Web, Win, Distributed
    Donnerstag, 7. Mai 2009 16:06