Posts

Showing posts from April, 2024

How Proxy Server Works With Node Js practical

      // Require the 'net' module for TCP networking   const net = require (' net ');       // Define the target host and port     const targetHost = ' localhost '; // Specify the hostname of the target server     const targetPort = 80 ; // Specify the port of the target server     // Create a TCP server     const server = net . createServer (( clientSocket ) => {         // Establish a connection to the target host         const targetSocket = net . createConnection ({ host: targetHost , port: targetPort }, () => {             // When data is received from the target server, write it back to the client             targetSocket . on (" data ", ( data ) => {                 clientSocket . write ( data );             });...

Google Login IN HTML CSS JS

 index.html <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Login with Google</ title > </ head > < body >     < h1 >Login with Google</ h1 >     < button onclick =" oauthSignIn () ">Login with Google</ button >     < script >         function oauthSignIn () {             var oauth2Endpoint = ' https://accounts.google.com/o/oauth2/v2/auth ';             // ADD HERE YOUR CLIENT ID             var clientId = ' YOUR_CLIENT_ID ';             var redirectUri = ' http://127.0.0.1:5500/login.html ';             var scope = ' https://www.go...

Login With Google Only Button Not Feature In Html Css js

    < html >     < head >         < meta name =" google-signin-client_id " content =" YOUR_CLIENT_ID.apps.googleusercontent.com ">     </ head >     < body >         < div id =" google-btn "></ div >         < script >             function renderButton () {                 gapi . signin2 . render (' google-btn ', {                     ' scope ': ' profile email ',                     ' width ': 240 ,                     ' height ': 50 ,                     ' longtitle ': true ,                     ' theme ': ' dark ',  ...

C++ Mouse Middle click up down

          # include < Windows.h >     # include < iostream >     int main ()     {         // Set the cursor position where you want to click         int x = 300 ;         int y = 300 ;         // click middleDown         mouse_event (MOUSEEVENTF_MIDDLEDOWN, x, y, 0 , 0 );         // click middleUP         mouse_event (MOUSEEVENTF_MIDDLEUP, x, y, 0 , 0 );         return 0 ;     }

C++ Mouse Click UP And Down

          # include < Windows.h >     # include < iostream >     int main ()     {         // Set the cursor position where you want to click         int x = 300 ;         int y = 300 ;         // Simulate a left mouse button down event         mouse_event (MOUSEEVENTF_LEFTDOWN, x, y, 0 , 0 );         // Simulate a left mouse button up event         mouse_event (MOUSEEVENTF_LEFTUP, x, y, 0 , 0 );         return 0 ;     }

C++ Check Mouse Visibility (Hidden or Visible)

      # include < iostream >     # include < Windows.h >     int main ()     {         // Get the current cursor info         CURSORINFO cursorInfo;         cursorInfo . cbSize = sizeof (cursorInfo);         GetCursorInfo ( & cursorInfo);         if ( cursorInfo . flags == CURSOR_SHOWING)         {             std ::cout << " Cursor visibility: Visible ";         }         else         {             std ::cout << " Cursor visibility: Hidden ";         }         return 0 ;     }

C++ restrict the cursor movement in rectangle

      # include < iostream >     # include < Windows.h >     int main ()     {         // Create a rectangle to restrict the cursor movement         RECT clipRect = { 50 , 50 , 200 , 200 };         ClipCursor ( & clipRect);         std ::cout << " Cursor movement restricted to (50, 50) - (200, 200) " << std ::endl;         return 0 ;     }

C++ Set Cursor Position

      # include < iostream >     # include < Windows.h >     int main ()     {         // Move the cursor to a new position         SetCursorPos ( 100 , 100 );         std ::cout << " Moved cursor to (100, 100) " << std ::endl;         return 0 ;     }

C++ Find Cursor Position

 C++ Find The Current Position of the cursor using windows.h library      # include < iostream >     # include < Windows.h >     int main ()     {         POINT cursorPos;                 int prevX = 0 ;         int prevY = 0 ;         while ( true )         {             // Get cursor position             GetCursorPos ( & cursorPos);             // Check if cursor position has changed             if ( cursorPos . x != prevX || cursorPos . y != prevY)             {                 // Update previous cursor position                 prevX = cursorPos . x ; ...