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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to exit C#.Net Application?

How to exit C#.Net Application?

Scheduled Pinned Locked Moved C#
csharphelptutorialquestion
5 Posts 3 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.
  • S Offline
    S Offline
    Sri harini
    wrote on last edited by
    #1

    Hi, I am developing windows mobile application..I want to exit my application.Not automatically exited.So i am trying to use the code..But Process.GetProcessesByName not supported in windows mobile application.(Compact Framework)..Can you help me how to terminate?..I tried in many ways, this.Dispose(), this.Close(), Application.Exit()....But not exiting..please help me.. string processName = "MBitNetwork"; Process[] processes = Process.GetProcessesByName (processName); foreach (Process process in processes) { process.Kill(); } Immediate help is appreciated. Bye

    S S 2 Replies Last reply
    0
    • S Sri harini

      Hi, I am developing windows mobile application..I want to exit my application.Not automatically exited.So i am trying to use the code..But Process.GetProcessesByName not supported in windows mobile application.(Compact Framework)..Can you help me how to terminate?..I tried in many ways, this.Dispose(), this.Close(), Application.Exit()....But not exiting..please help me.. string processName = "MBitNetwork"; Process[] processes = Process.GetProcessesByName (processName); foreach (Process process in processes) { process.Kill(); } Immediate help is appreciated. Bye

      S Offline
      S Offline
      sam
      wrote on last edited by
      #2

      did you try Application.Exit(); or Application.ExitThread();

      S 1 Reply Last reply
      0
      • S sam

        did you try Application.Exit(); or Application.ExitThread();

        S Offline
        S Offline
        Sri harini
        wrote on last edited by
        #3

        Hello, yaa, already tried Application.Exit()..that one Application hanging.. so i tried this.Dispose()..second time i have to run the application..can not run it..because application still background runing. So, finally how to kill the exe file? I didn't try Application.ExitThread()..i will try it...Thanks for your reply... Bye

        S 1 Reply Last reply
        0
        • S Sri harini

          Hello, yaa, already tried Application.Exit()..that one Application hanging.. so i tried this.Dispose()..second time i have to run the application..can not run it..because application still background runing. So, finally how to kill the exe file? I didn't try Application.ExitThread()..i will try it...Thanks for your reply... Bye

          S Offline
          S Offline
          sam
          wrote on last edited by
          #4

          try System.Threading.Thread.CurrentThread.Abort();

          1 Reply Last reply
          0
          • S Sri harini

            Hi, I am developing windows mobile application..I want to exit my application.Not automatically exited.So i am trying to use the code..But Process.GetProcessesByName not supported in windows mobile application.(Compact Framework)..Can you help me how to terminate?..I tried in many ways, this.Dispose(), this.Close(), Application.Exit()....But not exiting..please help me.. string processName = "MBitNetwork"; Process[] processes = Process.GetProcessesByName (processName); foreach (Process process in processes) { process.Kill(); } Immediate help is appreciated. Bye

            S Offline
            S Offline
            Seishin
            wrote on last edited by
            #5

            Environment.Exit(-1);

            life is study!!!

            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