473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Associating File Types - Continued

Jason, could you please explain to me what else I have to do?
Your filename will be passed as the first argument on the command line.
Check it with something like this:

static void Main(string[] args)
{
if (args.Length == 1 && System.IO.File.Exists(args[0]))
{
Application.Run(new MainWindow(args[0]));
}
else
{
Application.Run(new MainWindow(null));
}
}

......and you can handle loading the file in your application class
constructor.

-Jason
Nov 16 '05 #1
3 1132
Well Bill, I had to leave something for you to do yourself. Add a
constructor to your form that takes a string argument, open the file
that was passed in and figure out how to get the contents of the file
into your control. I'm too busy right now to work up a more detailed
example. I'm sure others will jump in if you have more specific questions.

-Jason

Bill English wrote:
Jason, could you please explain to me what else I have to do?
Your filename will be passed as the first argument on the command line.
Check it with something like this:

static void Main(string[] args)
{
if (args.Length == 1 && System.IO.File.Exists(args[0]))
{
Application.Run(new MainWindow(args[0]));
}
else
{
Application.Run(new MainWindow(null));
}
}

....and you can handle loading the file in your application class
constructor.

-Jason

Nov 16 '05 #2
\ || Add a
|| constructor to your form that takes a string argument
/

I have no clue what that means. Could someone please help me.
Nov 16 '05 #3
I finally got it. Thank you so much!
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Psymaster | last post by:
How could I do that? I'm writing an image viewer and I would want to associate all images to be opened with my proggie when they are double-clicked.
0
by: vpcs | last post by:
I am trying to do an invoicing software with perl - cgi. I am having a problem in associating the checkbox with the items from the database. I am giving the user option to enter the customer...
2
by: Dave Smithz | last post by:
Hello, Is there a way of associating what colour the hyperlinks should be within a particular class? Let me elaborate: I am using programming to generate HTML code. I want different...
6
by: Bill English | last post by:
How do I associate file types with my application, and use its icon? Also is there an event I can use for when my application is loaded by opening those filetypes? Ex. Open a .rtf, and I want my...
0
by: zerodot | last post by:
string keyName; string keyValue; keyName = "MyApp"; keyValue = "My App"; RegistryKey key,subkey; key = Registry.ClassesRoot.CreateSubKey(keyName); key.SetValue("",keyValue); subkey =...
0
by: carl.manaster | last post by:
Hi, In <http://groups-beta.google.com/group/microsoft.public.dotnet.languages.csharp/msg/05abaf8460c61859>, back in 2003, "SleazySt" wrote that > Unfortunately, C# projects can't have...
8
by: Penny | last post by:
Hi All, I have a continuous form which shows meetings that consultants have booked for certain timeslots. The text of the field displays a short description of the appointment and I want to set...
1
by: asger_gronnow | last post by:
Hi I'm having trouble associating file types with my app. Associating a file type works as long as the file type is already associated with another program but if the file type doesn't exist...
3
by: bg_ie | last post by:
Hi, Lets say I have a TreeView with nodes that represent objects of a number of different types. Is there a way of associating the Set method of each object with its node in the TreeView? That...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.