wininet

C++/WinInet Change Proxy Settings Windows 7

[Disclaimer: this is a Windows 7 specific issue as far as I can tell] I've got a block of code that changes the proxy settings in the Windows registry, then proceeds to call the WinInet API with the following: InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);...

How to send a HTTP POST Request in Delphi using WinInet api.

Hello, I am trying to make HTTP Requests from Delphi using the WinInet functions. So far I have: function request:string; var hNet,hURL,hRequest: HINTERNET; begin hNet := InternetOpen(PChar('User Agent'),INTERNET_OPEN_TYPE_PRECONFIG or INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); if Assigned(hNet) then begin try hURL := I...

How to delete Webbrowser Control Cookie C# IE8

I need some code here. I need to delete these blasted cookies once and for all. WebBrowser wb = new WebBrowser(); wb.Navigate("www.cookieparadise.info"); //load string cookie = wb.Document.Cookie; //cookie = "this=cookie1;that=cookie2;etc=more;"; I need to delete Document.Cookie. Please dont suggest any javascript because it doesnt wo...

Creating robust HTTP connection for dummy users with WinINET

I'm making a program which downloads a simple file from internet on Windows, using Wininet family API because I want to utilize its IE-compatible proxy behavior. As you all know, current IE has several proxy settings: auto-detect (WPAD), auto-configure (PAC), manually single URL, proxy servers per protocol, socks, direct, ... For most us...

InternetReadFile returns corrupted response

Hi, Am doing a GET(REST) and using InternetReadFile API to read response which is an xml, it works fine when the response is small but when the response is more then 10kb InternetReadFile returns data with junk characters in between or it chops some portion of data. When i try to reconstruct the response due to presence of junk charac...

Searching & retrieving filenames from an FTP site using wininet.dll api

Hi all, I've been trying to use the wininet.dll api to search an ftp site for matching files but it's not working for some reason. Here's the method i've been using. Private Sub DoStuff() Dim hConnection As Long, hOpen As Long, sOrgPath As String, lRes As Long Dim scUserAgent$ scUserAgent$ = "vb wininet" hOpen = Inte...

WinInet google maps data api receive error Invalid Token

I am trying to login to Google maps data API (get MyMaps) with wininet and delphi but always recevied response: Invalid Token. I have gotten auth toke with wininet HTTPS call. What's the problem ? Please help.Here a example code : ServerURL='maps.google.com'; pathURL='/maps/feeds/maps/default/full'; headers='Authorization: Googl...

Simple wrapper function for WinInet post (in Delphi)

Here is a way to do an HTTP post using Indy, in one line, more or less: Response := FIdHttp.Post(URL, StringStream); Is there a function out there (function, not library) that allows the equivalent to be done using WinInet? Preferably, a function that resembles this: function PostUsingWinInet(const URL, Data :string; SSL :boolean) :...

Does WinAPI::InternetCheckConnection put a load on the server?

Our program calls InternetCheckConnection every 2 seconds to test whether the program is connected to our server. We have around 4000 clients running our program. Now the server response is slow, despite its processor is almost idle and the free memory is high enough. Is it possible that InternetCheckConnection puts a load on our server...

How to create a local-server that the web-browser control can use

For my newest windows-application I want to create an interface that is web-based using the web-browser control, and I want to make Ajax work on it. Since all the content will be loaded by the web-browser control itself I want to create a web-server that would work on a localhost port and serve my content to the web-browser when it acces...

Asynchronous request using wininet

I have already used wininet to send some synchronous HTTP requests. Now, I want to go one step further and want to request some content asynchronously. The goal is to get something "reverse proxy"-like. I send an HTTP request which gets answered delayed - as soon as someone wants to contact me. My thread should continue as if there was...

Dev C++ Wininet Upload file using HTTP

I want to upload "C:\test.txt" to webserver, when I am running program, file is not uploading and I am not getting any error. the complete C++ code can be find here and php code on webserver can be find here: "http://student114.110mb.com/upload.txt" or "http://student114.110mb.com/upload.php" kindly help me where I am doing wrong ...

WinInet and SOAP

Hoi, I tried to create a soap request using the WinInet API, however adding headers with SOAP etc seems to fail. Is this a known issue or can WinInet not be used for SOAP? Any help or sample is highly appreciated. Jasper ...

Override IP in HTTP Request

Looking for a way to issue an HTTPwebrequest, or use the browser control, or winhttp to make a request to a URL, but override the IP address it connects to from the DNS lookup to a specific one. Trying to do something similar to the HOSTS file, but programatically without having to modify this file. It can be C# or C+ Why I need it, t...

WinInet and SOAP

Hi, Currently I use the CURL open transport library to genereate http requests with a soap header. This all is implemented in C/C++. I was able to port this to Windows mobile howver I wonder whether I can use WinInet to do the SOAP request? Just to use less memory on the mobile device. Are there samples on how to do this? Thanks in ad...

FtpOpenFile returns nil instead of file handle when uploading

Hi, I'm transferring a file using ftp in Delphi. I am able to connect to the ftp account ok but when I try and upload a file the FtpOpenFile function returns nil instead of a handle the file to be uploaded. hintfile := FtpOpenFile(hintconnect,PChar(tgtfn),GENERIC_WRITE,FTP_TRANSFER_TYPE_BINARY,0); If I log into the ftp site using a...

WinInet C++ ftp template?

Starting from scratch, would like to create an ftp application using WinInet. Looking for a real basic example in C++ that will compile and get me started. Thanks. ...

How do I wrap CFtpFileFind example, in C++?

Trying to wrap this short example in C++. (and its been a while since I did this). int main(int argc, char* argv[]) { //Objects CFtpConnection* pConnect = NULL; //A pointer to a CFtpConnection object ftpClient UploadExe; //ftpClient object pConnect = UploadExe.Connect(); UploadExe.GetFiles(pConnect); ...

Why is FormatMessage() failing to find a message for WinINet errors?

I'm running this to test FormatMessage: LPVOID lpMsgBuf; errCode=12163; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM , 0, errCode, 0, (LPTSTR) &lpMsgBuf, 0, NULL ); However, when it returns lpMsgBuf contains NULL... I was expecting something like ERROR_INTERNET_DISCONNECTED....

How to find out when WinInet proxy setting have changed

Is there any windows API to register a callback for when the WinInet proxy settings have changed? ...