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

Visual Basic

 
QuestionReports?? Pin
hounetdev8-Apr-04 6:29
hounetdev8-Apr-04 6:29 
AnswerRe: Reports?? Pin
Sarvesvara (BVKS) Dasa9-Apr-04 18:45
Sarvesvara (BVKS) Dasa9-Apr-04 18:45 
QuestionHow to Kill multiple processes? Pin
ndalal8-Apr-04 6:02
ndalal8-Apr-04 6:02 
GeneralHooking password textbox Pin
a4hd8-Apr-04 5:20
a4hd8-Apr-04 5:20 
GeneralRe: Hooking password textbox Pin
Colin Angus Mackay8-Apr-04 5:54
Colin Angus Mackay8-Apr-04 5:54 
GeneralRe: Hooking password textbox Pin
Heath Stewart8-Apr-04 8:42
protectorHeath Stewart8-Apr-04 8:42 
GeneralFile associations & File Types Editor Pin
nvmoss8-Apr-04 4:59
nvmoss8-Apr-04 4:59 
GeneralRe: File associations & File Types Editor Pin
Nadroj8-Apr-04 7:55
Nadroj8-Apr-04 7:55 
ok so you have associated your file type with your application in folder options > file types? that is step 1.

<br />
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Dim fileName As String = System.Environment.CommandLine.Substring( _<br />
        System.Environment.CommandLine.IndexOf(Chr(34) & " " & Chr(34)) + 3)<br />
<br />
        'this is now a string containing the exact path & filename which was opened with the program.<br />
        fileName = fileName.Substring(0, fileName.Length - 1)<br />
<br />
        'then in this sub or another, do something with the file:<br />
        '(in this case, open the file, and copy the text in it into a textbox)<br />
        Dim inFile As IO.StreamReader = IO.File.OpenText(fileName)<br />
        textBox1.text = inFile.ReadToEnd<br />
        inFile.Close()<br />
<br />
End Sub<br />


all you need here really is the 'fileName' string which i setup for you, and you can do what you want with it, or you can use the exact example above and test it out.

let me know if this helps.

[many thanks to the Rage man himself.]

------------------------
Jordan.
III
GeneralRe: File associations &amp; File Types Editor Pin
nvmoss13-Apr-04 7:10
nvmoss13-Apr-04 7:10 
GeneralRe: File associations &amp; File Types Editor Pin
Nadroj13-Apr-04 7:43
Nadroj13-Apr-04 7:43 
GeneralRe: File associations &amp; File Types Editor Pin
nvmoss13-Apr-04 8:41
nvmoss13-Apr-04 8:41 
GeneralRe: File associations &amp; File Types Editor Pin
Nadroj13-Apr-04 8:44
Nadroj13-Apr-04 8:44 
GeneralRe: File associations &amp; File Types Editor Pin
Dave Kreskowiak13-Apr-04 9:18
mveDave Kreskowiak13-Apr-04 9:18 
GeneralRe: File associations &amp; File Types Editor Pin
nvmoss13-Apr-04 10:16
nvmoss13-Apr-04 10:16 
GeneralRe: File associations &amp; File Types Editor Pin
Dave Kreskowiak13-Apr-04 10:20
mveDave Kreskowiak13-Apr-04 10:20 
GeneralRe: File associations &amp; File Types Editor Pin
nvmoss13-Apr-04 10:35
nvmoss13-Apr-04 10:35 
GeneralRe: File associations &amp; File Types Editor Pin
Dave Kreskowiak13-Apr-04 11:03
mveDave Kreskowiak13-Apr-04 11:03 
GeneralRe: File associations &amp; File Types Editor Pin
nvmoss13-Apr-04 14:02
nvmoss13-Apr-04 14:02 
GeneralRe: File associations &amp; 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 &amp; 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 &amp; File Types Editor Pin
Dave Kreskowiak14-Apr-04 4:26
mveDave Kreskowiak14-Apr-04 4:26 
GeneralRe: File associations &amp; File Types Editor Pin
nvmoss14-Apr-04 5:23
nvmoss14-Apr-04 5:23 
GeneralRe: File associations &amp; File Types Editor Pin
Dave Kreskowiak14-Apr-04 8:40
mveDave Kreskowiak14-Apr-04 8:40 

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.