| | |
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 28 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 activedirectory ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox connect control conversion cryptographyc#winformsencryption csharp custom database datagrid datagridview dataset datetime degrees development disabled displayingopenforms draganddrop drawing encryption enum event excel file foreach form format forms ftp function gdi+ httpwebrequest image index index-error input install java label list listbox mandelbrot math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox serialization server setup sleep socket sql statistics stream string table text textbox thread time timer totaldays update user usercontrol validation visualstudio webbrowser windows winforms wpf xml





