wininet

How to detect specific (timeout) errors for THTTPReqResp SOAP requests?

 ̄綄美尐妖づ 提交于 2021-01-28 11:39:27
问题 In Delphi Tokyo 10.2.x a ESOAPHTTPException was an Exception descendant with a StatusCode property set in the creator: ESOAPHTTPException = class(Exception) private FStatusCode: Integer; public {$IF CompilerVersion <= 15.0} constructor Create(const Msg: string; SCode: Integer = 0); {$ELSE} constructor Create(const Msg: string; SCode: Integer = 0; Dummy: Integer = 0); {$IFEND} constructor CreateFmt(const Msg: string; const Args: array of const; SCode: Integer = 0; Dummy: Integer = 0); property

Winsock use system proxy settings

依然范特西╮ 提交于 2021-01-27 14:20:32
问题 I have a simple winsock program and I want pass my connection through system proxy. I saw some post that explain how to catch system proxy and then send string like below: CONNECT 127.0.0.1:8080 HTTP/1.0\r\n and so on. But it doesn't work exactly all the time. In other hand, when using WinInet API ( InternetOpen() Function and ... ) it works perfectly. I need solution like WinInet that works correctly always and bidirectional functionality like Winsocket. 回答1: There is no such thing as a

Checking internet connection from C++ code

☆樱花仙子☆ 提交于 2020-05-10 06:59:05
问题 While working with large codebase for legacy applications, whenever I have seen a piece of code that checks whether an internet connection is active or not, I have mostly seen the uses of functions such as: InternetCheckConnection(L"http://www.google.com",FLAG_ICC_FORCE_CONNECTION,0) //or BOOL bConnected = IsNetworkAlive(&dwSens) //or InternetGetConnectedState(&dwReturnedFlag, 0) //or some other functions but there exists a very very simple way to do this where you wouldn't need to include

How to send HTTPS request using WinInet?

拈花ヽ惹草 提交于 2020-04-08 09:27:29
问题 I want to send HTTPS GET request using WinInet. As far as i know, i should do it just like sending HTTP request except i have to use INTERNET_DEFAULT_HTTPS_PORT and INTERNET_FLAG_SECURE flag. So here is what i tried: #include "stdafx.h" #include <string> #include <windows.h> #include <WinInet.h> #pragma comment (lib, "Wininet.lib") using namespace std; // convert string wstring CharPToWstring(const char* _charP) { return wstring(_charP, _charP + strlen(_charP)); } // send https request

How to send HTTPS request using WinInet?

▼魔方 西西 提交于 2020-04-08 09:26:06
问题 I want to send HTTPS GET request using WinInet. As far as i know, i should do it just like sending HTTP request except i have to use INTERNET_DEFAULT_HTTPS_PORT and INTERNET_FLAG_SECURE flag. So here is what i tried: #include "stdafx.h" #include <string> #include <windows.h> #include <WinInet.h> #pragma comment (lib, "Wininet.lib") using namespace std; // convert string wstring CharPToWstring(const char* _charP) { return wstring(_charP, _charP + strlen(_charP)); } // send https request

Unable to set WinInet proxy from WinForms application

寵の児 提交于 2020-01-25 14:39:52
问题 I'm running windows 7 and IE9. I'm writing a winforms application (.net 4.0 & c#) that runs a proxy server (using TcpListener) on another thread. Before I instantiate the main form i set the proxy using InternetSetOption and start the proxy server. My proxy setting code is very similar to the one here: Set Proxy UserName and Password using Wininet in C# then i browse to a site in IE, IE doesn't connect to my proxy server. also, IE tools --> internet options --> connection --> lan settings -->

VB6 — using POST & GET from URL and displaying in VB6 Form

我与影子孤独终老i 提交于 2020-01-23 04:08:29
问题 How can my VB6 form POST 2 vars, pull the results from a URL and then assign a VB6 var to the results? I need someone to show me VERY basic VB6 sample code or point me in the right direction. This is the simplest form - in the final product, the PHP vars will write to MySQL, but that's not what i need help with. I have a simple PHP page that accepts 2 parameters: test.php?var1=secret&var2=pass Here's my really simple PHP code <?php $var1 = $_GET['var1']; $var2 = $_GET['var2']; $varAcc =

wininet.h not compiling using GNU GCC compiler with code blocks

本小妞迷上赌 提交于 2020-01-17 17:30:22
问题 i'm getting a peculiar issue when trying to compile my program. I don't have a huge ammount of experience with C++. I'm trying to simple create a function that can FTP put a file upto my plain FTP server. I'm using codeblocks IDE, and the GNU GCC compiler, and in the end, i thought to try a full fledged example i found online to test if it was me writing some silly code. I have installed the windows SDK with all libs, so i can confirm the files are present, and if i build without any code,

wininet.h not compiling using GNU GCC compiler with code blocks

本秂侑毒 提交于 2020-01-17 17:30:10
问题 i'm getting a peculiar issue when trying to compile my program. I don't have a huge ammount of experience with C++. I'm trying to simple create a function that can FTP put a file upto my plain FTP server. I'm using codeblocks IDE, and the GNU GCC compiler, and in the end, i thought to try a full fledged example i found online to test if it was me writing some silly code. I have installed the windows SDK with all libs, so i can confirm the files are present, and if i build without any code,

Retrieve default internet timeout values?

て烟熏妆下的殇ゞ 提交于 2020-01-05 16:49:02
问题 I'm trying to retrieve the default values for the INTERNET_OPTION_SEND_TIMEOUT , INTERNET_OPTION_SEND_TIMEOUT , and INTERNET_OPTION_RECEIVE_TIMEOUT options flags. From what I read, they are in WinInit. The below code fails to compile with Types of actual and formal var parameters must be identical , but which parameter is incorrect here? procedure TFrmWininetTimeOuts.FormShow(Sender: TObject); var hSession : HINTERNET; dwTimeOut : DWORD; begin hSession := InternetOpen('usersession', INTERNET