CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2008
    Posts
    8

    block internet connection for one program

    yeah, i posted in the other thread first, but nobody answered, so now im creating my own thread, the question is:
    How do I disable the internet connection for one program? And no, I do not want to install a firewall, its only for one program/process.

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: block internet connection for one program

    I don't get it.... A firewall is supposed to do this work. So, basically, if you find a way to do this, you are writing somekind of firewall.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    Oct 2008
    Posts
    8

    Re: block internet connection for one program

    Call it what you want... I just don't want to install a firewall, i want to make my own, but I still don't know how to block one process and not an ip address

  4. #4
    Join Date
    Oct 2008
    Posts
    8

    Re: block internet connection for one program

    nobody knows that?

  5. #5
    Join Date
    Oct 2008
    Posts
    8

    Re: block internet connection for one program

    push

  6. #6
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: block internet connection for one program

    Sorry, I don't understand very well your question, and maybe I am not the only one, which would explain why you have no answers.

    At first, I was thinking you did not want your program to surf on the web. But since a program does what it is programmed to, the solution would simply be to program it so that it does not connect to the web.

    Now, maybe you mean that you want to prevent your program being launched remotely via an internet connection. Do you know under which circumstances this might occur? Maybe you can take conservative measures like placing it outside of the directories visible form internet or adding security rights to your program so that it could be launched only by some authorized users.

  7. #7
    Join Date
    Oct 2008
    Posts
    8

    Re: block internet connection for one program

    lol okay:

    I've got two programs:
    1. my self-coded program
    2. another program that connects to the internet (e.g. iexplore.exe)

    I want the 1. program to block the 2. programs internet connection so it can't connect to the network/internet

  8. #8
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: block internet connection for one program

    Check out the following articles:
    http://www.codeguru.com/forum/showthread.php?t=413766
    http://www.codeplex.com/netdefender
    http://www.codeproject.com/KB/IP/smfirewall.aspx (I don't know if you can adapt this to filter on program basis).
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  9. #9
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: block internet connection for one program

    Quote Originally Posted by Damner
    lol okay:

    I've got two programs:
    1. my self-coded program
    2. another program that connects to the internet (e.g. iexplore.exe)

    I want the 1. program to block the 2. programs internet connection so it can't connect to the network/internet
    #2 is BY DEFINITION a Firewall. Period.

    You have already been given some links on writing a firewall, and there have been many other (searchable) threads here on CG. There was even an article earlier this year if my memory serves me....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  10. #10
    Join Date
    Oct 2008
    Posts
    8

    Re: block internet connection for one program

    Thanks but Ive already found those sites and theres only described how you block a port / ip address, but I want to know how to block the entire programs connection

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured