Home » » HotSpot for Windows 7 in C Program

HotSpot for Windows 7 in C Program

This is useful program to share internet using hotspot. Generally laptops having wifi can not use hotspot. There is ad-hoc utility but it is useful for windows to windows not for android phones or linux. So with this program users can share internet to other devices easily.
  1. /* This Program set, start and stop hotspot in windows 7.*/
  2. #include
  3. #include
  4. #include
  5. int t=0;
  6. void frame(void);
  7. void main()
  8. {
  9. start0:
  10. clrscr();
  11. int c;
  12. textcolor(5+t);
  13. gotoxy(40,8);
  14. cprintf("Please Run this program as");
  15. gotoxy(40,9);
  16. cprintf("Administrator.");
  17. gotoxy(40,13);
  18. cprintf("Right Click on Program-> ");
  19. gotoxy(40,14);
  20. cprintf("Run as Administrator.");
  21. start:
  22. frame();
  23. cprintf("Enter choice : ");
  24. gotoxy(27,23);
  25. scanf("%d",&c);
  26. textcolor(5+t);
  27. switch(c)
  28. {
  29. case 1: //set hotspot
  30. system("netsh wlan set hostednetwork mode=allow ssid=Hotspot key=vgecvgec keyusage=persistent");
  31. clrscr();
  32. gotoxy(40,8);
  33. cprintf("Done !!! Hotspot Set !!!");
  34. gotoxy(40,9);
  35. cprintf("Now you can start Hotspot");
  36. gotoxy(40,11);
  37. cprintf("Name : Hotspot");
  38. gotoxy(40,12);
  39. cprintf("Password : vgecvgec");
  40. gotoxy(40,14);
  41. cprintf("To start Hotspot Use option 2");
  42. goto start;
  43. case 2: //start hotspot
  44. system("netsh wlan start hostednetwork");
  45. clrscr();
  46. gotoxy(40,8);
  47. cprintf("Started Successfully.");
  48. gotoxy(40,11);
  49. cprintf("Name : Hotspot");
  50. gotoxy(40,12);
  51. cprintf("Password : vgecvgec");
  52. gotoxy(40,20);
  53. cprintf("Not Started ?");
  54. gotoxy(40,22);
  55. cprintf("Please See Help.");
  56. goto start;
  57. case 3: //stop hotspot
  58. system("netsh wlan stop hostednetwork");
  59. clrscr();
  60. gotoxy(40,8);
  61. cprintf("Stopped Successfully.");
  62. goto start;
  63. case 4:
  64. t++;
  65. if(t>=4){t=0;}
  66. goto start0;
  67. case 5:
  68. clrscr();
  69. gotoxy(39,8);
  70. cprintf("Follow Steps to use Hotspot :");
  71. gotoxy(39,10);
  72. cprintf("1. Run Program as Administrator.");
  73. gotoxy(39,11);
  74. cprintf("2. Set up Hotspot If using");
  75. gotoxy(39,12);
  76. cprintf(" first time");
  77. gotoxy(39,13);
  78. cprintf("3. Start Hotspot and Use.");
  79. gotoxy(39,14);
  80. cprintf("4. stop Hotspot");
  81. gotoxy(40,17);
  82. cprintf("Name : Hotspot");
  83. gotoxy(40,18);
  84. cprintf("Password : vgecvgec");
  85. gotoxy(39,21);
  86. cprintf("For more enter 51.");
  87. goto start;
  88. case 51:
  89. clrscr();
  90. gotoxy(39,8);
  91. cprintf("How to connect Another Net");
  92. gotoxy(39,9);
  93. cprintf("Connection with Hotspot.");
  94. gotoxy(39,11);
  95. cprintf("1. Open Network and sharing");
  96. gotoxy(39,12);
  97. cprintf(" centre->Change Adpter");
  98. gotoxy(39,13);
  99. cprintf(" Settings->");
  100. gotoxy(39,14);
  101. cprintf("2. Now Right Click on Adpter");
  102. gotoxy(39,15);
  103. cprintf(" which has internet.");
  104. gotoxy(39,16);
  105. cprintf("3. In sharing tab, check both");
  106. gotoxy(39,17);
  107. cprintf(" box. Now Open settings and");
  108. gotoxy(39,18);
  109. cprintf(" check all boxes.");
  110. gotoxy(39,21);
  111. cprintf("For more queries Contact Me.");
  112. gotoxy(39,22);
  113. cprintf("See About.");
  114. goto start;
  115. case 6:
  116. clrscr();
  117. gotoxy(40,7);
  118. cprintf("=============================");
  119. gotoxy(40,8);
  120. cprintf(" Bhargav K Patel ");
  121. gotoxy(40,9);
  122. cprintf("=============================");
  123. gotoxy(40,13);
  124. cprintf("Email : ");
  125. gotoxy(40,15);
  126. cprintf(" bhargav079@gmail.com");
  127. gotoxy(40,18);
  128. cprintf("Facebok : ");
  129. gotoxy(40,20);
  130. cprintf(" www.facebook.com/olodoio");
  131. goto start;
  132. case 7:
  133. exit (0);
  134. default:
  135. clrscr();
  136. gotoxy(40,8);
  137. cprintf("Invalid Choice.");
  138. goto start;
  139. }
  140. }
  141. void frame(void)
  142. {
  143. textcolor(2+t);
  144. for(int i=5;i<=70;i++)
  145. {
  146. gotoxy(i,1);
  147. cprintf("%c",220);
  148. }
  149. for(i=5;i<=70;i++)
  150. {
  151. gotoxy(i,24);
  152. cprintf("%c",220);
  153. }
  154. for(i=2;i<=24;i++)
  155. {
  156. gotoxy(5,i);
  157. cprintf("%c",219);
  158. }
  159. for(i=2;i<=24;i++)
  160. {
  161. gotoxy(70,i);
  162. cprintf("%c",219);
  163. }
  164. textcolor(1+t);
  165. for(i=6;i<=69;i++)
  166. {
  167. gotoxy(i,5);
  168. cprintf("%c",254);
  169. }
  170. for(i=6;i<=34;i++)
  171. {
  172. gotoxy(i,21);
  173. cprintf("%c",22);
  174. }
  175. textcolor(9+t);
  176. for(i=6;i<=23;i++)
  177. {
  178. gotoxy(35,i);
  179. cprintf("%c%c",204,185);
  180. }
  181. textcolor(12-t);
  182. gotoxy(25,3);
  183. cprintf("Hotspot for Windows 7");
  184. textcolor(14-t);
  185. gotoxy(8,7);
  186. cprintf("1. Set for first use");
  187. gotoxy(8,9);
  188. cprintf("2. Start Hotspot");
  189. gotoxy(8,11);
  190. cprintf("3. Stop Hotspot");
  191. gotoxy(8,13);
  192. cprintf("4. Change Color theme");
  193. gotoxy(8,15);
  194. cprintf("5. Help");
  195. gotoxy(8,17);
  196. cprintf("6. About");
  197. gotoxy(8,19);
  198. cprintf("7. Exit");
  199. gotoxy(8,23);
  200. textcolor(24-t);
  201. return;
  202. }
  203.  

Share this article :