.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command Line Args from Network File?

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
150 Views, 0 Replies

Command Line Args from Network File?


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...

 

Thanks for any help!

 


Module

subMain


Public 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

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost