Loading with a file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tomomichi Amano

    Loading with a file

    Hello. Normally when you click on a TXT file, NOTEPAD starts up and shows
    the file.
    How do I do this in my own program (what do I do with the program, how, what
    do I do with the file settings, how?)?

    <I am making a text editor, and I want my program to load and show TXT files
    when they are clicked>

    Thanks in advance.

  • Justin Rogers

    #2
    Re: Loading with a file

    You need to use the registry and set a file association between .txt and
    your application. There are probably some ways to handle this automatically
    with WMI or installers.

    --
    Justin Rogers
    DigiTec Web Consultants, LLC.

    "Tomomichi Amano" <tomomichi_a@ho tmail.com> wrote in message
    news:eJhJOOfcDH A.1072@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hello. Normally when you click on a TXT file, NOTEPAD starts up and shows
    > the file.
    > How do I do this in my own program (what do I do with the program, how,[/color]
    what[color=blue]
    > do I do with the file settings, how?)?
    >
    > <I am making a text editor, and I want my program to load and show TXT[/color]
    files[color=blue]
    > when they are clicked>
    >
    > Thanks in advance.
    >[/color]


    Comment

    • Morten Wennevik

      #3
      Re: Loading with a file

      Replace the static void/int Main() method with static void/int
      Main(string[] args);
      Then you can simply try to use whatever is entered as a file name, like
      "MyNotepad c:\mytextfile.t xt"
      string filename = args[0]; // == c:\mytextfile.t xt

      --
      Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

      Comment

      Working...