Message 1 of 1
Command Line Args from Network File?
Not applicable
12-19-2005
08:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got a VB.NET application that converts PDFs to
TIFs. It works fine with all files using the dialog box interface, but I thought
I'd go crazy and add a right-click menu option. When I try this right click
option locally, it works just fine. When I try in on a file located on the
network, it won't pick up the file name or path like it does from a local file.
Anyone have any tips for getting this to work? the Command Line Arg
function I'm using is below...
TIFs. It works fine with all files using the dialog box interface, but I thought
I'd go crazy and add a right-click menu option. When I try this right click
option locally, it works just fine. When I try in on a file located on the
network, it won't pick up the file name or path like it does from a local file.
Anyone have any tips for getting this to work? the Command Line Arg
function I'm using is below...
Thanks for any help!
Module
subMainPublic frmSingleFile
As
color=#0000ff size=2>New frmSingleFile
Public frmPDF2TIF
As
color=#0000ff size=2>New frmPDF2TIF
Public CLA
color=#0000ff size=2>As
size=2>String
Public CLFolder
As
color=#0000ff size=2>String
Sub Main()
Dim x
color=#0000ff size=2>As
size=2>Integer
If
Len(GetCommandLineArgs(0)) > 0
size=2>Then
GetCommandLineArgs()
If
UBound(GetCommandLineArgs) > 0
size=2>Then
For x = 0
color=#0000ff size=2>To UBound(GetCommandLineArgs)
CLA = CLA & " " & GetCommandLineArgs(x)
Next
MsgBox(CLA) 'for
testing
CLFolder = Trim(Left(CLA, InStrRev(CLA, "\")))
CLFolder = Right(CLFolder, Len(CLFolder) - 1)
'MsgBox(CLFolder)
color=#000000> 'for
testing
End
color=#0000ff size=2>If
MsgBox(CLA) 'for
testing
MsgBox(CLFolder) 'for testing
frmSingleFile.ShowDialog()
Else
frmPDF2TIF.ShowDialog()
End
color=#0000ff size=2>If
End
color=#0000ff size=2>Sub
Public
color=#0000ff size=2>Function GetCommandLineArgs()
As
color=#0000ff size=2>String()
' Declare variables.
size=2>
Dim separators
As
color=#0000ff size=2>String = " "
Dim commands
As
color=#0000ff size=2>String =
Microsoft.VisualBasic.Command()
Dim args()
color=#0000ff size=2>As
size=2>String = commands.Split(separators.ToCharArray)
Return args
End
color=#0000ff size=2>Function
End
size=2>Module