fastburst
asked on
vb.net open file with exe created.
Ok, this is something I havent had to do before and I know there is a way.
Example:
You go to my computer and see a text file and you RIGHT-CLICK it and Select OPEN WITH here you get an option to open with notepad wordpad etc. OR you can browse to a different application to open the file with.
Here is where I want the application to be able to open the file with the Application I created. However when I select my Application, it launches the application but doesnt load anything into the textbox iteself.
I know I have to place some code to handle that, the question is what code and how?
Below is the simple textreader app I would like to know where and what code would handle this. Searching the Internet I found 1000's of things that look just like my code but havent found anything that would do what I described.
Example:
You go to my computer and see a text file and you RIGHT-CLICK it and Select OPEN WITH here you get an option to open with notepad wordpad etc. OR you can browse to a different application to open the file with.
Here is where I want the application to be able to open the file with the Application I created. However when I select my Application, it launches the application but doesnt load anything into the textbox iteself.
I know I have to place some code to handle that, the question is what code and how?
Below is the simple textreader app I would like to know where and what code would handle this. Searching the Internet I found 1000's of things that look just like my code but havent found anything that would do what I described.
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oReader As StreamReader
OpenFileDialog1.CheckFileExists = True
OpenFileDialog1.CheckPathExists = True
OpenFileDialog1.DefaultExt = "txt"
OpenFileDialog1.FileName = ""
OpenFileDialog1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
OpenFileDialog1.Multiselect = False
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
oReader = New StreamReader(OpenFileDialog1.FileName, True)
TextBox1.Text = oReader.ReadToEnd
End If
End Sub
End Class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Guess I'm a little slow today!... =D
ASKER
LOL Sorry Idle_Mind, your usually the first to reply to mine. Maybe next time. =)
Open in new window