exe a dial up connection

This is a discussion on exe a dial up connection within the Windows Programming forums, part of the Platform Specific Boards category; hi all i have just finished this small program to log who made a connection along with the time and ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    21

    exe a dial up connection

    hi all
    i have just finished this small program to log who made a connection along with the time and date.

    Code:
    #include <time.h>
    #include <windows.h>
    #include <stdio.h>
    void main(int)
    {
      char datebuf[9];    //time and date
      char timebuf[9];
      char temp[2];        //buffer to swap dd/mm
      
      TCHAR buff[256];    //user name
      DWORD size = 256;
    
      char filename[15];
      strcpy(filename,"H:/Dialup.log");    //this is the location to save to                                    
      FILE *fptr;                        //file pointer
    
    
      _strdate(datebuf);        //get time and date
      _strtime(timebuf);
      GetUserName(buff,&size);    //get logged on user
    
    
    temp[0] = datebuf[0];   //to sort from mm/dd/yy to dd/mm/yy
    temp[1] = datebuf[1];
    datebuf[0] = datebuf[3];
    datebuf[1] = datebuf[4];
    datebuf[3] = temp[0];
    datebuf[4] = temp[1];
    
    
    
    if((fptr=fopen(filename,"a"))==NULL)    /*amend*/
                {
                    printf("Error: File %s could not be created.\n\a",filename);
                    printf("Check the disk is not full or protected.\n");
                        /*buzzer if error*/
                }
    
    
      fprintf(fptr,"User: %s\t\tDate: %s\tTime: %s\n",buff,datebuf,timebuf);
      fclose(fptr);
    }
    however i dont know how to make C exe a dial up connection.
    also a dial up has a strange location eg. {262480y48rwhdqw8eryq23}

    or an easier way whould be to attch the c program to the dial up so that if the dial up is clicked on it will also run the above C program, but i dont know how to do that either.

    hope you can help
    thx

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    21
    to clear up that last bit

    how can i get clicking on a network connection to run a c program

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. multiple forks in one client connection (ftpclient)
    By Dynamo in forum Networking/Device Communication
    Replies: 5
    Last Post: 01-16-2011, 11:41 AM
  2. reuse a socket connection
    By radeberger in forum Networking/Device Communication
    Replies: 0
    Last Post: 03-18-2009, 11:38 AM
  3. Sharing connection to wired PC from wireless
    By psychopath in forum Tech Board
    Replies: 1
    Last Post: 01-06-2008, 12:44 AM
  4. passing a connection to another process.
    By Kinasz in forum Networking/Device Communication
    Replies: 3
    Last Post: 10-09-2004, 05:34 PM
  5. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21