Click here to Skip to main content
15,908,841 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: File associations & File Types Editor Pin
Nadroj13-Apr-04 7:43
Nadroj13-Apr-04 7:43 
GeneralRe: File associations & File Types Editor Pin
nvmoss13-Apr-04 8:41
nvmoss13-Apr-04 8:41 
GeneralRe: File associations & File Types Editor Pin
Nadroj13-Apr-04 8:44
Nadroj13-Apr-04 8:44 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak13-Apr-04 9:18
mveDave Kreskowiak13-Apr-04 9:18 
GeneralRe: File associations & File Types Editor Pin
nvmoss13-Apr-04 10:16
nvmoss13-Apr-04 10:16 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak13-Apr-04 10:20
mveDave Kreskowiak13-Apr-04 10:20 
GeneralRe: File associations & File Types Editor Pin
nvmoss13-Apr-04 10:35
nvmoss13-Apr-04 10:35 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak13-Apr-04 11:03
mveDave Kreskowiak13-Apr-04 11:03 
nvmoss wrote:
The error is probably the result of 2 drive letters and 2 colons.

Nope...The problem is that your using Environment.CommandLine. It will return the ENTIRE command line, including the command that started your app.

The solution is use Environment.GetCommandLineArgs(). This will return an array of Strings, the first of which, index 0, will be the command that started the app. Index 1 will be the first argument:
|----------- Index 0 --------------| |------------------- Index 1 ------------------------|
C:\Program Files\myCompany\myApp.exe C:\Documents and Settings\userID\Desktop\fileToUse.txt

Dim cmdArgs As String()
cmdArgs = Environment.GetCommandLineArgs()

cmdArgs(0) will be "C:\Program Files\myCompany\myApp.exe" and
cmdArgs(1) will be "C:\Documents and Settings\userID\Desktop\fileToUse.txt",
of course, without the quotes.


RageInTheMachine9532
GeneralRe: File associations & File Types Editor Pin
nvmoss13-Apr-04 14:02
nvmoss13-Apr-04 14:02 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak13-Apr-04 17:02
mveDave Kreskowiak13-Apr-04 17:02 
GeneralRe: File associations & File Types Editor Pin
nvmoss14-Apr-04 2:08
nvmoss14-Apr-04 2:08 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak14-Apr-04 2:42
mveDave Kreskowiak14-Apr-04 2:42 
GeneralRe: File associations & File Types Editor Pin
nvmoss14-Apr-04 3:40
nvmoss14-Apr-04 3:40 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak14-Apr-04 4:26
mveDave Kreskowiak14-Apr-04 4:26 
GeneralRe: File associations & File Types Editor Pin
nvmoss14-Apr-04 5:23
nvmoss14-Apr-04 5:23 
GeneralRe: File associations & File Types Editor Pin
Dave Kreskowiak14-Apr-04 8:40
mveDave Kreskowiak14-Apr-04 8:40 
GeneralRe: File associations & File Types Editor Pin
Heath Stewart8-Apr-04 8:50
protectorHeath Stewart8-Apr-04 8:50 
GeneralPass Server Exception to Client proxy Pin
Anonymous8-Apr-04 2:46
Anonymous8-Apr-04 2:46 
GeneralWrite into a text file Pin
Daminda8-Apr-04 0:33
Daminda8-Apr-04 0:33 
GeneralRe: Write into a text file Pin
Dave Kreskowiak8-Apr-04 2:16
mveDave Kreskowiak8-Apr-04 2:16 
GeneralRe: Write into a text file Pin
Nadroj8-Apr-04 3:03
Nadroj8-Apr-04 3:03 
Generalanyone can provide simple code for printing??VB.NET Pin
MJay7-Apr-04 21:26
MJay7-Apr-04 21:26 
Generalmultiple projects in a solution Pin
PaleyX7-Apr-04 13:50
PaleyX7-Apr-04 13:50 
GeneralRe: multiple projects in a solution Pin
Dwayne J. Baldwin7-Apr-04 15:30
Dwayne J. Baldwin7-Apr-04 15:30 
GeneralRe: multiple projects in a solution Pin
PaleyX7-Apr-04 16:20
PaleyX7-Apr-04 16:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.