RE: open from dskop

From: JWhitted (jason_whitted[at]hotmail[dot]com)
Date: 11/10/04


Date: Wed, 10 Nov 2004 08:52:02 -0800

When you double click an "associated" file, it passes the path of the
associated file to the associated program as an argument. You have to handle
this argument in your application.

An example would look like:

using System;
using System.IO;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
    public Form1(string[] args)
    {
        if(args.Length>0 && File.Exists(args[0]))
        {
            MessageBox.Show(String.Format("TODO: Implement code to open the
'{0}' file.", args[0]);
        }
    }

    public static void Main(string[] args)
    {
        Application.Run(new Form1(args));
    }
}

In the VS.NET IDE, you can "pass" command line arguments to the application
by doing the following:

Open up the Project's Properties Dialog Box. In the "Configuration
Properties" section, select "Debugging". In the "Start Options" section,
specify the desired file's path in the "Command Line Arguments" section.

Hope that helps.

--
Jason Whitted


Relevant Pages

  • Re: Problem when redeined macro for floats with usepackage{color}
    ... tables) so that single spacing is used. ... % - User can specify draft copies, ... The \beforepreface command creates the title page, ...
    (comp.text.tex)
  • Re: debug Console Application
    ... > the command line arguments? ... Go to the Project Properties (right click on project and select Properties, ... expand and select Debugging. ... There, under Start Options, you can specify ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problem when redeined macro for floats with usepackage{color}
    ... % - User can specify draft copies, ... The \beforepreface command creates the title page, ... % so that single spacing is used. ...
    (comp.text.tex)
  • RE: DTS and stored procedure
    ... There is a command prompt utility "dtsrun". ... The DTS package can be stored in the Microsoft® SQL Server™ ... Specify server_name to ... Displays the encrypted command used to execute the DTS package without ...
    (microsoft.public.sqlserver.dts)
  • Re: not in domain
    ... You can use the netdom command as long as you have admin credentials on the ... NETDOM JOIN Joins a workstation or member server to the domain. ... If you specify a domain controller, ... VBScript & Windows PowerShell Training - ...
    (microsoft.public.scripting.vbscript)