Click here to Skip to main content
16,003,462 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDatabases Pin
Leavashni1-Mar-06 22:17
Leavashni1-Mar-06 22:17 
QuestionHow to make my application multilingual? Pin
sp_ranjan1-Mar-06 22:15
sp_ranjan1-Mar-06 22:15 
AnswerRe: How to make my application multilingual? Pin
Ingo2-Mar-06 2:52
Ingo2-Mar-06 2:52 
GeneralRe: How to make my application multilingual? Pin
sp_ranjan2-Mar-06 3:01
sp_ranjan2-Mar-06 3:01 
GeneralRe: How to make my application multilingual? Pin
Ingo2-Mar-06 3:14
Ingo2-Mar-06 3:14 
QuestionMovie Reservation system Pin
Siew Chin1-Mar-06 21:50
Siew Chin1-Mar-06 21:50 
AnswerRe: Movie Reservation system Pin
Dave Kreskowiak2-Mar-06 8:19
mveDave Kreskowiak2-Mar-06 8:19 
Questionhow to change vb98 project to vb.net2005 project Pin
fanronghua1-Mar-06 21:15
fanronghua1-Mar-06 21:15 
AnswerRe: how to change vb98 project to vb.net2005 project Pin
Paritos1-Mar-06 22:56
Paritos1-Mar-06 22:56 
Questioncopy macro into xls file Pin
lonely_life1-Mar-06 21:01
lonely_life1-Mar-06 21:01 
QuestionTreeview problem in vb.net Pin
pankajgarg121-Mar-06 20:25
pankajgarg121-Mar-06 20:25 
AnswerRe: Treeview problem in vb.net Pin
Dave Kreskowiak2-Mar-06 7:42
mveDave Kreskowiak2-Mar-06 7:42 
QuestionOpen a file when it is double clicked Pin
Chatura Dilan1-Mar-06 20:19
Chatura Dilan1-Mar-06 20:19 
AnswerRe: Open a file when it is double clicked Pin
noshaba mariam1-Mar-06 21:23
noshaba mariam1-Mar-06 21:23 
AnswerRe: Open a file when it is double clicked Pin
J4amieC1-Mar-06 21:53
J4amieC1-Mar-06 21:53 
GeneralRe: Open a file when it is double clicked Pin
Chatura Dilan2-Mar-06 1:12
Chatura Dilan2-Mar-06 1:12 
GeneralRe: Open a file when it is double clicked Pin
J4amieC2-Mar-06 1:16
J4amieC2-Mar-06 1:16 
First you have to understand what windows does (by default) when you associate a file extension with an executable program. It executes the .exe passing the file name as the first parameter like this:

C:\myFolder\MyExecutable "C:\myData\the_file_I_d_clicked.sln"

So, you need to support arguments in your executable, and if the first argument is a valid location of a file, then open it at startup instead of a blank document.

Here, I wrote a little example for you:

I had a textbox and a button, on the button I have this code:

String str = tbInput.Text;<br />
StreamWriter sr = new StreamWriter(@"C:\test.abc");<br />
sr.Write(str);<br />
sr.Close();


Then in my app start code I have this (note: string[] args are the arguments passed into the exe)

if(args.Length>0)
{
	string path = args[0];
	if(Path.GetExtension(path) == ".abc" && File.Exists(path))
	{
		StreamReader sr = new StreamReader(path);
		this.tbInput.Text = sr.ReadToEnd();
		sr.Close();
	}
}


sorry, forgot which forum I was on...here in VB.NET
if(args.Length>0)then

	string path = args[0]
	if(Path.GetExtension(path) = ".abc" and File.Exists(path))then
	
		StreamReader sr = new StreamReader(path)
		this.tbInput.Text = sr.ReadToEnd()
		sr.Close()
	end if
end if


-- modified at 8:24 Thursday 2nd March, 2006
GeneralRe: Open a file when it is double clicked Pin
Chatura Dilan2-Mar-06 14:13
Chatura Dilan2-Mar-06 14:13 
GeneralRe: Open a file when it is double clicked Pin
Omar Mallat2-Mar-06 2:02
professionalOmar Mallat2-Mar-06 2:02 
GeneralRe: Open a file when it is double clicked Pin
Chatura Dilan2-Mar-06 14:06
Chatura Dilan2-Mar-06 14:06 
QuestionHow to get the clients IP address using TcpClient in VB.Net Pin
Maher Abu Zer1-Mar-06 20:19
professionalMaher Abu Zer1-Mar-06 20:19 
AnswerRe: How to get the clients IP address using TcpClient in VB.Net Pin
Dave Kreskowiak2-Mar-06 5:35
mveDave Kreskowiak2-Mar-06 5:35 
AnswerRe: How to get the clients IP address using TcpClient in VB.Net Pin
Maher Abu Zer2-Mar-06 6:34
professionalMaher Abu Zer2-Mar-06 6:34 
GeneralRe: How to get the clients IP address using TcpClient in VB.Net Pin
Dave Kreskowiak2-Mar-06 7:37
mveDave Kreskowiak2-Mar-06 7:37 
QuestionTreeeview problem in vb.net Pin
pankajgarg121-Mar-06 20:09
pankajgarg121-Mar-06 20:09 

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.