Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
Hello,
I'm using Single-Instance
http://www.codeproject.com/KB/cs/CSSIApp.aspx[^]

what i want is when we open .txt file by "Open With" i want my application to give me the path of the .txt in each time we open .txt

Example:
1. The user open .txt file , by "Open With" the application send the .txt file path to form2
2. After that form2 read the .txt file path (taken from form1)

Error:
if i have C:\01.txt and C:\02.txt When we open the first file we will find that the path is correct , but when we open the second file we will find the path is incorrect becouse is the first file path

My Code:
string[] args = Environment.GetCommandLineArgs();
foreach(string arg in args)
{
    MessageBox.Show(arg);
}


[edit DMA: Link fixed]
Posted
Updated 8-Oct-10 8:50am
v2
Comments
shakil0304003 8-Oct-10 12:35pm    
Your problem is not clear to me :(
Toli Cuturicu 8-Oct-10 14:34pm    
Poor question
DaveAuld 8-Oct-10 14:49pm    
The link you have provided in the question does not work..........i have now fixed it
king_888 9-Oct-10 4:16am    
Example:
if we double click on (.html) file Firefox will open it in new tap

i want the same thing but with (.txt) file
king_888 9-Oct-10 4:17am    
thank you DaveAuld

1 solution

use new kekword to solve the problem
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900