Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# HELP...here...about the popup file

C# HELP...here...about the popup file

Scheduled Pinned Locked Moved C#
csharphelptutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Missy Glory
    wrote on last edited by
    #1

    Hi programmer, Im doing a project, my question is " How to allow the file to popup when the button is click." The file is in (C:\Documents and Settings\Lohsk\My Documents\Introduction.txt). Can someone help me :confused:.The program must written in c#.

    C L M 3 Replies Last reply
    0
    • M Missy Glory

      Hi programmer, Im doing a project, my question is " How to allow the file to popup when the button is click." The file is in (C:\Documents and Settings\Lohsk\My Documents\Introduction.txt). Can someone help me :confused:.The program must written in c#.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Process.Start will open your text file in the default program ( probably notepad ). You can use File.ReadAllText to read it and display it yourself.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • M Missy Glory

        Hi programmer, Im doing a project, my question is " How to allow the file to popup when the button is click." The file is in (C:\Documents and Settings\Lohsk\My Documents\Introduction.txt). Can someone help me :confused:.The program must written in c#.

        L Offline
        L Offline
        liewcp
        wrote on last edited by
        #3

        try this:- private void button1_Click(object sender, EventArgs e) { try { System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = @"C:\Documents and Settings\Lohsk\My Documents\Introduction.txt"; process.StartInfo.ErrorDialog = true; process.Start(); } catch (Exception err) { MessageBox.Show(err.ToString()); } }

        1 Reply Last reply
        0
        • M Missy Glory

          Hi programmer, Im doing a project, my question is " How to allow the file to popup when the button is click." The file is in (C:\Documents and Settings\Lohsk\My Documents\Introduction.txt). Can someone help me :confused:.The program must written in c#.

          M Offline
          M Offline
          Muammar
          wrote on last edited by
          #4

          System.Diagnostics.Process.Start("YourTextFile.txt");


          Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups