hi all,
i've made a simple console application that is designed to read some text files, find instances of a string, and replace it with something else. i wanted a user to be able to specify command line parameters for passing in the target text and the replacement text. to this end, i used the "command" method as follows...
i've made a simple console application that is designed to read some text files, find instances of a string, and replace it with something else. i wanted a user to be able to specify command line parameters for passing in the target text and the replacement text. to this end, i used the "command" method as follows...
Code:
Function getParameters(ByRef oldPath As String, ByRef newPath As String) As Boolean
Dim sText As String
Dim arPaths() As String
Dim srReader As System.IO.StreamReader
sText = Command()
If sText = "" Then
printInstructions()
Return False
Else
...
[\code]
the program runs aok, i thought, until i took it into work, copied to a remote location via a mapped drive and tried to run it. i got an immediate crash with the following (condensed) error message.
An unhandled exception of type System.Security.SecurityException occurred in MSCORLIB.DLL
i also had a mapped drive to a shared folder on my local drive. i found that if i tried to run the program through the mapped drive to my local folder, the program crashed. if i ran it directly from the local folder, it ran aok.
i got home and created a mapped drive to a local folder with the same results. the debugger indicates that the program crashes on the line "sText = Command()", where it tries to read any command line options.
any ideas why?
thanks,
glenn