Myanmar IT Resource Forum
Myanmar IT Resource Forum
Myanmar IT Resource Forum

You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Get External IP Address Empty Get External IP Address 27th December 2009, 8:33 pm

Eracobengo

Eracobengo
MITR Reader



MITR Reader
Code:
#include <windows.h>
#include <wininet.h>
#include <iomanip>

using namespace std;
#pragma comment(lib, "wininet");

void GetIp()
{
    HINTERNET hInternet, hFile;
    char Buffer[1024];
    DWORD ReadSize;
    FILE *File;

    hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);

    hFile = InternetOpenUrl(hInternet, "http://whatismyip.com/automation/n09230945.asp", NULL, 0, INTERNET_FLAG_RELOAD, 0);
    InternetReadFile(hFile, &Buffer, sizeof(Buffer), &ReadSize);

   File = fopen("External IP.txt", "a+");
    Buffer[ReadSize] = '\0';
    fputs(Buffer, File);
    fclose(File);

    InternetCloseHandle(hFile);
    InternetCloseHandle(hInternet);
}   

int main()
{
   ShowWindow(GetConsoleWindow(), NULL);
   GetIp();

   return 0;
}

http://computerunipyay.blog.com

2Get External IP Address Empty Re: Get External IP Address 28th December 2009, 7:49 pm

Eracobengo

Eracobengo
MITR Reader



MITR Reader
အင္း...တစ္ေယာက္မွလည္း..ေကာင္းတယ္ဆိုးတယ္လာမေၿပာၾကဘူးေနာ္..တင္ရတာအားေတာင္ငယ္လာ
ၿပီ...နည္းနည္းေလာက္အေၿခအေနေလးေၿပာၾကပါဦးဗိ်ဳ႔

http://computerunipyay.blog.com

3Get External IP Address Empty Re: Get External IP Address 24th February 2010, 6:25 pm

Tayzakoko

Tayzakoko
MITR New User



အစ္ကိုေရ
ေကာင္းမေကာင္းေတာ့ မ run ၾကည္႔ရေသးဘူး အခုလိုတင္ေပးတာ ေက်းဇူးအရမ္းတင္ပါတရ္
ေနာက္လဲ ၾကိဳးစားေပးပါအံုးေနာ္။
က်ေနာ္ အျမဲ အားေပးပါ့မရ္။

http://shwekyintharpoem.blogspot.com

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

 

Create a forum on Forumotion | Computers and Internet | Computers | ©phpBB | Free forum support | Report an abuse | Forumotion.com