wininet

Download URL Contents Directly into String (VB6) WITHOUT Saving to Disk

柔情痞子 提交于 2019-12-06 01:08:33
Basically, I want to download the contents of a particular URL (basically, just HTML codes in the form of a String) into my VB6 String variable. However, there are some conditions. I know about the URLDownloadToFile Function - however, this requires that you save the downloaded file/HTML onto a file location on disk before you can read it into a String variable, this is not an option for me and I do not want to do this. The other thing is, if I need to use an external library, it must already come with all versions of Windows from XP and onwards, I cannot use a control or library that I am

Is there any good example of http upload using WinInet c++ library

≡放荡痞女 提交于 2019-12-05 00:22:11
问题 I cannot get my code to work :/ 回答1: Here's a quick example from Microsoft. static TCHAR hdrs[] = _T("Content-Type: application/x-www-form-urlencoded"); static TCHAR frmdata[] = _T("name=John+Doe&userid=hithere&other=P%26Q"); static LPSTR accept[2]={"*/*", NULL}; // for clarity, error-checking has been removed HINTERNET hSession = InternetOpen("MyAgent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); HINTERNET hConnect = InternetConnect(hSession, _T("ServerNameHere"), INTERNET_DEFAULT_HTTP

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

流过昼夜 提交于 2019-12-04 19:47:28
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 = "ACCEPTED"; $varDen = "DENIED"; if ($var1 === "secret" && $var2 === "pass") { echo $varAcc; } else { echo

How can I download a huge file via TIdHTTP?

六眼飞鱼酱① 提交于 2019-12-04 12:08:27
I use this code to download small files: Var ms:TMemoryStream; begin ms:=TMemoryStream.Create; Idhttp1.get('http://mydomain.com/myfile.zip',ms); ms.SaveToFile('myfile.zip'); ms.Free; end; But file is saved in RAM before storing to disk, so it may be difficult to download files >1Gb, for example. Is there a way to download a file by its parts? Or do I need to use the WinInet? Thanks in advance! Rob Kennedy TMemoryStream provides an in-memory buffer, so if you download into one, you need to have enough memory to hold everything you receive. It's not the only kind of stream, though. You can pass

InternetOpenUrl only returns after entire HTTP response is downloaded

狂风中的少年 提交于 2019-12-04 06:58:07
I am writing a download file utility using WinINET, and have noticed (especially on large downloads), that the WinINET InternetOpenUrl() call only returns after the entire HTTP response has been downloaded. I confirmed this by using the Charles proxy tool, as well as using WireShark, and noticed that the download completes entirely and only then does WinINET notify my code. Some simplified (synchronous) code: hInt = InternetOpen(USER_AGENT_NAME, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); DWORD dwRequestFlags = INTERNET_FLAG_NO_UI // no UI please |INTERNET_FLAG_NO_AUTH // don't authenticate

Delphi soap https authentication failure pops up a dialog box

℡╲_俬逩灬. 提交于 2019-12-04 06:16:55
We have a delphi XE application that uses SOAP (THTTPRIO etc) communications which (in delphi) works over WinInet.dll, by default. We fixed the authentication code so that it works, using https authentication, and when the user name and password for https are correct, everything is fine. The problem is that when authentication details are incorrect, you get a message box from Windows, that is probably being popped up by WinInet.dll itself. I want to make that dialog box go away. I can't figure out how to change my Delphi SOAP so the password won't come up. The situation is different than this

Why does GetErrorMessage return “wrong password”, when the user name is wrong?

跟風遠走 提交于 2019-12-04 03:46:36
问题 GetErrorMessage (from CInternetException) gives me the following: With the incorrect ftp server name: "ERROR! The server name or address could not be resolved" With the incorrect password: ERROR! The password was not allowed With the incorrect user name: ERROR! The password was not allowed <-----? NO separate message for incorrect username? Is this intended? try { pConnect = sess->GetFtpConnection(host, userName, password, port, FALSE ); } catch (CInternetException* pEx) //incorrect user name

How i can retrieve the error description for a WinInet error code from delphi

家住魔仙堡 提交于 2019-12-04 03:37:01
I need to obtain the description of an WinInet function error code, The MSDN documentation about the WinInet functions says which I must use the GetLastError function to retrieve the last error code when a functions fails. Now when I check the documentation about the GetLastError function says . .To obtain an error string for system error codes, use the FormatMessage function I check which the SysErrorMessage delphi function internally calls the FormatMessage winapi function, so i am using that function to retrieve the error description, but is not working (I mean does not return a description

How to get a response message of LIST command (from CFTPConnection)

十年热恋 提交于 2019-12-04 02:19:28
问题 How can I get a response of LIST command executed with CFTPConnection::Command() . I can get the directory listing. But not free space size information. Windows IIS FTP server gives free space as response of LIST command: How to check free space in a FTP Server? 回答1: It does not look like that the MFC CFTPConnection class has an API to access the response message of the command executed. Though as the class is just a wrapper around Win32 Wininet functions, you can use

Why does GetErrorMessage return “wrong password”, when the user name is wrong?

♀尐吖头ヾ 提交于 2019-12-01 19:47:41
GetErrorMessage (from CInternetException) gives me the following: With the incorrect ftp server name: "ERROR! The server name or address could not be resolved" With the incorrect password: ERROR! The password was not allowed With the incorrect user name: ERROR! The password was not allowed <-----? NO separate message for incorrect username? Is this intended? try { pConnect = sess->GetFtpConnection(host, userName, password, port, FALSE ); } catch (CInternetException* pEx) //incorrect user name displays incorrect password? { TCHAR sz[1024]; pEx->GetErrorMessage(sz, 1024); printf("ERROR! %s\n",