How to open the attached item in the application button click

venky

Active member
Joined
Sep 12, 2005
Messages
27
Programming Experience
1-3
First of all i thank full to all.

actually my problem is ,In my application Added NEW text item .I want to view this text file after btn click.
Please any one have an idea regarding this please help me.
 

venky

Active member
Joined
Sep 12, 2005
Messages
27
Programming Experience
1-3
Thanks for quick reply

But my requirement is automatically get the current application path,Even though after deployment the project in different location.

Below is the code what i am using. I think it is lengthy ,Is there any short form of the same work.

try
{
Process p;
String s;
p=new Process();
//p.StartInfo.FileName = @"F:\C#dotnet\Energy Audit\venky.txt";
s = AppDomain.CurrentDomain.BaseDirectory;
s=s+@"venky.txt";
p.StartInfo.FileName =s;
p.StartInfo.Arguments ="";
p.Start();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
 

albertkhor

Well-known member
Joined
Jan 12, 2006
Messages
150
Programming Experience
Beginner
kulrom said:
Embedded text file has not purpose to be opened but rather to holds some values ...
Otherwise if you want to open separated text file you can make it very simple:

Process.Start(path)

HTH
Regards ;)

Process.Start cannot be use to open HTML file? if i want to open html file how?
 

albertkhor

Well-known member
Joined
Jan 12, 2006
Messages
150
Programming Experience
Beginner
kulrom said:
Use an argument as address of the HTML document that you want to open ... like this:
VB.NET:
[SIZE=2]System.Diagnostics.Process.Start("IExplore.exe", "www .jugoars.com")[/SIZE]



Regards ;)

Sorry Kurom i didn't give u all the info! The html file is in my computer (from word save as html). i only want to open it.
 

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
albertkhor said:
Sorry Kurom i didn't give u all the info! The html file is in my computer (from word save as html). i only want to open it.

You want to open it but how? Maybe just like JuggaloBrotha exampled above or you want to open HTML document with some editors (DW, WORD etc.). Or finally you want to open it inside your .NET desktop application?
 

albertkhor

Well-known member
Joined
Jan 12, 2006
Messages
150
Programming Experience
Beginner
kulrom said:
You want to open it but how? Maybe just like JuggaloBrotha exampled above or you want to open HTML document with some editors (DW, WORD etc.). Or finally you want to open it inside your .NET desktop application?

i want to open the html with browser, just for view not for edit.
e.g. My html file at my C:/Help.html, when user click on Help button. System will open the html file which in C:/Help.html.
 
Top Bottom