| | |
get name of file opened through file association
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
0
#2 Oct 14th, 2009
Its a little ambiguous. do you want to know how to set file associations? or know how to catch the arguments passed to your app after its been associated?
I will assume the 2nd one, as the nature of the question looks to be of that.
you must modify your Main() function. If you are using microsoft visual studio on a Forms application this will be inside the "program.cs" file in the project solution. you must modify the Main method to accept a string array.
of course if you send it to Form1 this way you must alter form1's constructor to accept it
happy coding!
I will assume the 2nd one, as the nature of the question looks to be of that.
you must modify your Main() function. If you are using microsoft visual studio on a Forms application this will be inside the "program.cs" file in the project solution. you must modify the Main method to accept a string array.
C# Syntax (Toggle Plain Text)
Public Static Void Main(string[] Args) { //you can use it here by using Args[0] to refference it or you can pass it to the first form like: Application.Run(new Form1(Args)); }
of course if you send it to Form1 this way you must alter form1's constructor to accept it
C# Syntax (Toggle Plain Text)
string[] appArgs; public Form1( string[] Args) { appArgs = Args; }
happy coding!
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
0
#4 24 Days Ago
•
•
•
•
Its a little ambiguous. do you want to know how to set file associations? or know how to catch the arguments passed to your app after its been associated?
![]() |
Similar Threads
- File Copy (C++)
- file problem (C)
- dynamic opened file by fopen (C)
- printing to file-variable file name (Python)
- file handling problem (C++)
- reading a text file (C++)
- checking if a file is open using VB. (VB.NET)
- dat file txt file help???? (C)
- SYSTEM.INI - device file missing, no file name given (Windows 95 / 98 / Me)
Other Threads in the C# Forum
- Previous Thread: How to play Video?
- Next Thread: Algorithm LR parse for c sharp
| Thread Tools | Search this Thread |
.net access algorithm api array asp.net barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ httpwebrequest image index input install java label libraries list listbox loop mandelbrot math mouseclick movingimage mysql mysql.data.client operator path photoshop php picturebox pixelinversion post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf xml





