how to access to gmail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • admin171078
    New Member
    • Nov 2008
    • 2

    how to access to gmail

    i write code in c ,i only need to access to gmail using username and password

    i didn't know where i can write username and password in this code
    Code:
    #include <stdio.h>
    #include <afxinet.h>
    #include <wininet.h>
    #include <conio.h>
    #include <string.h>
    #include <winsock.h>
    void main()
    {
    
    		
                int nResult=0;int result=0;
                HINTERNET hInternet, hHttpSession, hHttpRequest;
    		
    		 hInternet= InternetOpen("MyApp", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
             if (hInternet){
    
    			 hHttpSession=InternetConnect(hInternet, "https://www.google.com/accounts/",INTERNET_DEFAULT_HTTPS_PORT, 0, 0, INTERNET_SERVICE_HTTP, 0, 0);}
                                                                                                                                
             if  (hHttpSession){
    			 hHttpRequest =HttpOpenRequest(hHttpSession, "POST", "/ServiceLoginAuth?service=mail", 0, 0, 0,INTERNET_FLAG_SECURE, 0);}
             if  (hHttpRequest){ result=HttpSendRequest(hHttpRequest, 0, 0, 0, 0); }
    			 	
                 printf("%d",&result);
    		  InternetCloseHandle(hInternet);
    	     
    		 InternetCloseHandle(hHttpSession);
    		 InternetCloseHandle(hHttpSession);
    		 InternetCloseHandle(hHttpSession);
    
    }
  • arnaudk
    Contributor
    • Sep 2007
    • 425

    #2
    Go to the gmail login page and look at the source code of the page to figure out how the login and password are submitted to the server. Then subit your own request to the server in a similar manner. It looks like the code you have just requests a webpage from the server, that's not what you need.

    Comment

    Working...