Monday, August 3, 2015

AAHOwifi (C Code and Executable)


When i posted the "AAHOwifi Java Netbens Project", i thought some one might just want to use it as a simple program to create hotspot. So, here is the C Code and Executable for someone who want to use it.

C Code for the AAHOwifi
BEGIN:

#include<stdio.h>
#include<string.h>
int main()
{
    int ch;
    char name[20],faltu;
    char pass[16];
    while(1)
    {
    printf("\nEnter the choice : \n\t\t1. Create a profile.\n\t\t2. Start hotspot.\n\t\t3. Stop hotspot.\n\t\t4. Clear Screen.\n\t\t5. Exit\n"); //print the choices on the control panel
    scanf("%d",&ch);  //get the user choice
    switch(ch)
    {
        case 1: printf("SSID(Name of hotspot) : "); // Create a new profile
                scanf("%s",&name); // get the hotspot name
                printf("Password : "); //get the hotspot password
                scanf("%s",&pass);
                char command[100];
                command[0]='\0';
                strcat(command,"netsh wlan set hostednetwork mode=allow ssid="); //concatinate -
                strcat(command,name); // - all the strings to make the windows command.
                strcat(command," key=");
                strcat(command,pass);
                //printf("%s",command);
                system(command); // Run the command on the terminal
                printf("\n\t\t Press any key to clear screen\n");
                fflush(stdin);
                faltu=getchar();
                system("cls"); // command to clear the device screen.
                break;
        case 2: system("netsh wlan start hostednetwork");  //Start the hotspot.
                printf("NOTE: Only one time configuration for a profile.\n\tTo share your lan internet with this network follow these steps:\n\t=>Right-Click on network icon in taskbar and select open network and sharing settings\n\t");
                printf("=>Open the network properties of the network with internet connection.\n\t=>Now goto Sharing tab and check  the 1st checkbox.\n\tNow select the hotspot name and click OK.\n");
                printf("The net should be working now. ENJOY!\n");
                break;
        case 3: system("netsh wlan stop hostednetwork"); //Stop the hotspot.
                break;
        case 4: system("cls"); //clear the screen.
                break;
        case 5: exit(0); // Exit the program.
                break;
        default: printf("you don't know which key is 1 0r 2 or 3 or 4 AAHO\n");
                 break;
    }
    }

}

END

Executable: Click on the link below to download the executable file.
https://drive.google.com/file/d/0B8yy_uELvVLlWjlZTTdyNDhxcTQ/view?usp=sharing

NOTE: I might upload the .exe files for the NetBeans Projects too. So, Subscribe for notification.


No comments:

Post a Comment