Results 1 to 3 of 3

Thread: Programming Help

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    11

    Programming Help

    Hi everyone there, I am a newbie in programming and need help from gurus. I want to write a program that will automatically stop my wireless connection to my pc at previously set time, how should i start? Thanks a lot.

  2. #2
    Forum Techie A_old's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta
    Posts
    10,663
    Well, I've already written one that'll restart all connections every few hours using .NET (it's at my website -- in the signature, under other applications).

    I can give you some pointers:

    Take a look at NETCONLib.NetSharingManager (again, this is .NET 2.0).

    Since it isn't anything special, I'll share the major portions of the code with you:

    Code:
    private void restartAllNetworkConnections()
    {
        disableAllNetworkConnections();
        enableAllNetworkConnections();
    }
    
    private void disableAllNetworkConnections()
    {
        NETCONLib.NetSharingManager net = new NETCONLib.NetSharingManager();
        NETCONLib.INetSharingEveryConnectionCollection col = net.EnumEveryConnection;
    
        foreach (object c in col)
        {
    	NETCONLib.INetConnection er = (NETCONLib.INetConnection)c;
    	er.Disconnect();
        }
    }
    
    private void enableAllNetworkConnections()
    {
        NETCONLib.NetSharingManager net = new NETCONLib.NetSharingManager();
        NETCONLib.INetSharingEveryConnectionCollection col = net.EnumEveryConnection;
    
        foreach (object c in col)
        {
    	NETCONLib.INetConnection er = (NETCONLib.INetConnection)c;
    	er.Connect();
        }
    }
    Obviously, you need to do the scheduling stuff and spruce this up, but it's an example to go off of. Also, it's not an entire program, just snippets.

  3. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    11
    Thanks a lot, will study it and make use of it.

Similar Threads

  1. Murphy's laws for Programming - Enjoy
    By striker8000 in forum General Discussion Board
    Replies: 3
    Last Post: 01-20-15, 08:26 AM
  2. Replies: 2
    Last Post: 05-27-09, 01:35 PM
  3. word programming problem with landscape
    By bekil in forum Programming Forum
    Replies: 1
    Last Post: 09-10-06, 10:36 PM
  4. Lithnet Programming Editor 1.0.0 Final
    By Paft in forum General Discussion Board
    Replies: 4
    Last Post: 05-19-05, 08:15 PM
  5. Looking For Best Websites To Find Freelance Programming Jobs
    By alex298 in forum Programming Forum
    Replies: 1
    Last Post: 03-30-05, 01:00 AM

Bookmarks

Posting Permissions

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