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. How to run a process forever

How to run a process forever

Scheduled Pinned Locked Moved C#
tutorialquestion
19 Posts 6 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.
  • C Calla

    Run it as an NT Service.

    X Offline
    X Offline
    Xelalem
    wrote on last edited by
    #4

    WATIF THE USER STOPS THE SERVICE. THE USER WILL HAVE ADMINISTRATIVE PRIVILAGE....

    M C 2 Replies Last reply
    0
    • L Lost User

      You can create Application or Service which you should start at windows logon. Service is the best way to use it. Service have the facility to start automatically.

      If you can think then I Can.

      X Offline
      X Offline
      Xelalem
      wrote on last edited by
      #5

      WATIF THE USER STOPS THE SERVICE. THE USER WILL HAVE ADMINISTRATIVE PRIVILAGE

      L 2 Replies Last reply
      0
      • X Xelalem

        WATIF THE USER STOPS THE SERVICE. THE USER WILL HAVE ADMINISTRATIVE PRIVILAGE

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #6

        Xelalem wrote:

        WATIF THE USER STOPS THE SERVICE.

        Always remember, it's the user's PC. Why should your software prevent him/her from being in control of their own computing platform.

        txtspeak is the realm of 9 year old children, not developers. Christian Graus

        X 1 Reply Last reply
        0
        • X Xelalem

          WATIF THE USER STOPS THE SERVICE. THE USER WILL HAVE ADMINISTRATIVE PRIVILAGE....

          M Offline
          M Offline
          Mirko1980
          wrote on last edited by
          #7

          Then you can't do much operating client-side. If the user is an Administrator he can do pretty much anything he want with his machine. If you want to forbid access to some URLs, I suggest you look using a proxy server application (such as websense). P.S.: don't shout.

          1 Reply Last reply
          0
          • X Xelalem

            WATIF THE USER STOPS THE SERVICE. THE USER WILL HAVE ADMINISTRATIVE PRIVILAGE....

            C Offline
            C Offline
            Calla
            wrote on last edited by
            #8

            Well, preventing the privilegies of an admin ofdoesn't sound right.. Maybe you should move your URL-checking from the local machine? And please don't shout.. :|

            1 Reply Last reply
            0
            • X Xelalem

              WATIF THE USER STOPS THE SERVICE. THE USER WILL HAVE ADMINISTRATIVE PRIVILAGE

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #9

              Yes off Cource User Can stop it if he have Administrator Privilages. You can use Auto start in a Minute. if it is not a good way. then you can use driver Development.

              If you can think then I Can.

              1 Reply Last reply
              0
              • L Lost User

                Xelalem wrote:

                WATIF THE USER STOPS THE SERVICE.

                Always remember, it's the user's PC. Why should your software prevent him/her from being in control of their own computing platform.

                txtspeak is the realm of 9 year old children, not developers. Christian Graus

                X Offline
                X Offline
                Xelalem
                wrote on last edited by
                #10

                this project is for univeristy computer lab.the users(students) may have administrative privilage but it's not their computer and they are not allowed to visit some websites. this websites are not blocked from the proxy server becouse staff members should access the websites... I create another process that checks the webfilter is in the process list every minlisecond and if the process is not in the list it will restart the application again... idially it was suppose to work .. but sometimes the other process does not restart the application... do you 've any idea how to solve the problem

                K 1 Reply Last reply
                0
                • X Xelalem

                  this project is for univeristy computer lab.the users(students) may have administrative privilage but it's not their computer and they are not allowed to visit some websites. this websites are not blocked from the proxy server becouse staff members should access the websites... I create another process that checks the webfilter is in the process list every minlisecond and if the process is not in the list it will restart the application again... idially it was suppose to work .. but sometimes the other process does not restart the application... do you 've any idea how to solve the problem

                  K Offline
                  K Offline
                  Keith Barrow
                  wrote on last edited by
                  #11

                  You need to apply an access policy at the proxy server, and maintaining a list of people who can see everything. As the students are admins on the client machines, they can stop whatever processes are running and therefore circumvent any security you put in place.

                  Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter. Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

                  1 Reply Last reply
                  0
                  • X Xelalem

                    i was developing an application that filters out web pages to privent users from viewing certain webpages. how can i make sure the process does not exit. even from task manager. i used another process that checks weather the process is still running and if not it will restart the application again but it creates delay. does any one have any idea how to do that

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #12

                    If you've done what most people do when they don't understand the problem at hand, you've created an app that will only work with IE. Any other browser will be unaffected. The proper way to do this would have been a proxy server that filters out URL's and will work with any browser.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008
                    But no longer in 2009...

                    X 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      If you've done what most people do when they don't understand the problem at hand, you've created an app that will only work with IE. Any other browser will be unaffected. The proper way to do this would have been a proxy server that filters out URL's and will work with any browser.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007, 2008
                      But no longer in 2009...

                      X Offline
                      X Offline
                      Xelalem
                      wrote on last edited by
                      #13

                      it works with any browser

                      D 1 Reply Last reply
                      0
                      • X Xelalem

                        i was developing an application that filters out web pages to privent users from viewing certain webpages. how can i make sure the process does not exit. even from task manager. i used another process that checks weather the process is still running and if not it will restart the application again but it creates delay. does any one have any idea how to do that

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #14

                        There is no way to keep your process from being killed by Task Manager and no way to hide it.

                        A guide to posting questions on CodeProject[^]
                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                             2006, 2007, 2008
                        But no longer in 2009...

                        X 1 Reply Last reply
                        0
                        • X Xelalem

                          it works with any browser

                          D Offline
                          D Offline
                          Dave Kreskowiak
                          wrote on last edited by
                          #15

                          I said, IF, you did what most people do... What is yours based on?

                          A guide to posting questions on CodeProject[^]
                          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                               2006, 2007, 2008
                          But no longer in 2009...

                          X 1 Reply Last reply
                          0
                          • D Dave Kreskowiak

                            I said, IF, you did what most people do... What is yours based on?

                            A guide to posting questions on CodeProject[^]
                            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                 2006, 2007, 2008
                            But no longer in 2009...

                            X Offline
                            X Offline
                            Xelalem
                            wrote on last edited by
                            #16

                            it extracts the title bar of any window and comapares each word with a black listed words. it's better than most webfilters. + you dont have to add every pornographic website in the black list. just the word porn or sex is enough to block almost all pornographic websites. + websites that opens another websites(like unblockanything.com) cant fool it... Any ways i was thinking to disable rigedit,taskmgr,cmd,gpedit.msc and gain access again by entering password to the webfilter application... wat do you think

                            D 1 Reply Last reply
                            0
                            • X Xelalem

                              it extracts the title bar of any window and comapares each word with a black listed words. it's better than most webfilters. + you dont have to add every pornographic website in the black list. just the word porn or sex is enough to block almost all pornographic websites. + websites that opens another websites(like unblockanything.com) cant fool it... Any ways i was thinking to disable rigedit,taskmgr,cmd,gpedit.msc and gain access again by entering password to the webfilter application... wat do you think

                              D Offline
                              D Offline
                              Dave Kreskowiak
                              wrote on last edited by
                              #17

                              Xelalem wrote:

                              + websites that opens another websites(like unblockanything.com) cant fool it...

                              Wanna bet? Since you just told me how it works, I can fool your app quite easily. I can the possibility of your algorithm closing windows that it shouldn't and not catching others that it should.

                              Xelalem wrote:

                              Any ways i was thinking to disable rigedit,taskmgr,cmd,gpedit.msc

                              EASILY defeatable. These are things that are better handled by policy since the loader won't even start an application that's in the exception list. Your alogithm has to let the app start before you kill it, AND you also risk data loss by killing a process without exiting it gracefully. The problem with black lists is that any technique dependant on them is following one of the 6 dubest ideas in computer security, "Enumeration of Badness". This means you're only catching stuff you know about. You're NOT catching the stuff you DON'T know about. Password? I don't need a password to unlock this stuff. I can STILL kill your service whith all of the above tools disabled. Remember that "don't know about" part? Yeah... Also, being a "web filter", disabling half the users system just to keep you filter running is hardly a viable concept. "I wanted something to filter bad websties and I got an application that won't allow me to do this, that, and these things either!" This alone will get your app uninstalled by just about every user who touches it.

                              A guide to posting questions on CodeProject[^]
                              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                   2006, 2007, 2008
                              But no longer in 2009...

                              1 Reply Last reply
                              0
                              • D Dave Kreskowiak

                                There is no way to keep your process from being killed by Task Manager and no way to hide it.

                                A guide to posting questions on CodeProject[^]
                                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                     2006, 2007, 2008
                                But no longer in 2009...

                                X Offline
                                X Offline
                                Xelalem
                                wrote on last edited by
                                #18

                                wat if i enject my process as a thread to one of the system processes... will that work?

                                D 1 Reply Last reply
                                0
                                • X Xelalem

                                  wat if i enject my process as a thread to one of the system processes... will that work?

                                  D Offline
                                  D Offline
                                  Dave Kreskowiak
                                  wrote on last edited by
                                  #19

                                  Nope. Managed code, C#, VB.NET, or any other language that targets the .NET CLR, cannot be injected into other processes, and you cannot inject code into the kernel.

                                  A guide to posting questions on CodeProject[^]
                                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                       2006, 2007, 2008
                                  But no longer in 2009...

                                  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