wininet

WinINet trouble downloading file to client?

血红的双手。 提交于 2019-12-11 16:17:59
问题 I'm curious why I'm having trouble with this function. I'm downloading a PNG file on the web to a destination path. For example, downloading the Google image to the C: drive: netDownloadData("http://www.google.com/intl/en_ALL/images/srpr/logo1w.png", "c:\file.png"); The file size is correct after downloading. Nothing returning false. When I try opening it it won't show the image. Any ideas are helpful. Thanks! Here's the code: bool netDownloadData(const char *strSourceUrl, const char

c++ winhttp/wininet wrapper to post forms and upload files without mfc/atl

放肆的年华 提交于 2019-12-11 12:47:37
问题 could somebody point me to a winhttp/wininet based c++ wrapper which would not require mfc/atl? So that I might get it to work in MSVC express. I'd like to be able to use GET, POST and upload files too through HTML-form. I've checked several in codeproject.com but had trouble finding a suitable wrapper. Is there something that could help me? 回答1: Here I made you one to get you started. If you are using a MSVC you should learn how to dig down through dll's and find exported functions. DLL

Can WinInet HttpQueryInfo return raw bytes? (HTTP Headers with unicode characters)

99封情书 提交于 2019-12-11 07:55:21
问题 The built-in routine HttpQueryInfo returns a string, not actual bytes. Normally that is not a problem. However, lately I have begin to encounter a problem with servers issuing redirects where the location header field contains an URL which includes non-percentage-encoded unicode/or? characters. Any way around this? var vContent_Wide: WideString; begin vBufferSize := 4096; GetMem(vBufferPtr, vBufferSize); while True do begin TmpFakeCardinal := 0; vErrorNone := HttpQueryInfo( hHttpOpen_Request,

Using std::filesystem output as LPCWSTR

做~自己de王妃 提交于 2019-12-11 04:12:50
问题 I'm making a program which recursively lists all files in a certain directory and uploads each file separately to an FTP server using WinINet. The problem I'm encountering is using filesystem::path::filename in the FtpPutFile() function because a LPCWSTR is needed. Whats the best and easiest way to convert it (or somehow use it as is)? std::string path = "C:\\Programs"; for (const auto & entry : std::experimental::filesystem::recursive_directory_iterator(path)) FtpPutFile(hIConnect, entry

Using VBA to attach a client certificate to a WinINet HTTPSendRequest

夙愿已清 提交于 2019-12-11 03:27:22
问题 (This is a more expansive discussion of the problem in Identifying correct client certificate for ServerXMLHTTP.SetOption, where I tried a workaround that ran into different problems.) I am attempting to restore a back-end web service capability in an MS Access database after the web server moved to certificate-based STS authentication. I must use VBA. I have the sequence of web calls and expected header and cookie returns ready, but I am unable to attach the client certificate to the request

SSL Certificate Context - How to get it using NPAPI

十年热恋 提交于 2019-12-10 17:56:53
问题 How to get the SSL certificate context of the website using NPAPI ? Can I use libnss (Network Security Services) or should I stick to WinINet's InternetQueryOption() to get the context. Thanks, Saleh 回答1: The NPAPI doesn't have anything that could give you that information and, as far as i know, neither has JavaScript in the page. So there is probably no way around retrieving the URL and using external libraries to get more information about it. 来源: https://stackoverflow.com/questions/4077060

Is Dot Net HttpClient Unexpectedly Caching Responses?

心已入冬 提交于 2019-12-10 16:58:38
问题 I'm attempting to write a curl-like tool that demonstrates the effect of various HTTP caching headers on dot net's HttpClient class. In my initial attempt I'm pointing the tool at one of my internal web services that does not specify any caching information in the response and examining the header of the response. I expect to see that the request is re-sent each time and executed on the server, returning a new but identical set of content each time (for the purpose of this test, the content

Soap Delphi Client end with a timeout for a 1MB call

ⅰ亾dé卋堺 提交于 2019-12-10 14:27:27
问题 we are developing a SOAP webservice (Apache/PHP). All run well for small size calls, but with a 1Mb soap call (the HTTPS call size is 1MB) our Delphi Soap client stop with a timeout on all PC but one, and our PHP clients run well with a default_socket_timeout=300, but stop with a "Error Fetching http headers" with default_socket_timeout=60. How can we change the timeout for Delphi? In fact this timeout seem to be in a Windows XP network library (wininet.dll called by soaphttptrans.pas) Thanks

Cannot download microsoft symbols when running cdb in a windows service

可紊 提交于 2019-12-10 13:07:40
问题 I have a .NET windows service that is calling cdb.exe to analyze crash dumps. I want to download the symbols from http://msdl.microsoft.com automatically when needed, using the argument: -y srv*c:\symbols*http://msdl.microsoft.com/download/symbols If I run the application as a console application, It works as expected and it downloads the needed symbols for each dump. The problem is when I start the app as a windows service, the symbols are not downloaded and, if I turn symnoisy on, at cdb's

Clearing IE Cache Programmatically vs InetCpl.cpl,ClearMyTracksByProcess

a 夏天 提交于 2019-12-10 10:46:51
问题 I have an application hosting the webbrowser control which clears the cache (regularly) using the code example provided my microsoft: http://support.microsoft.com/kb/262110 I am noticing however that after sometime the cache get corrupted or not working properly (requests that should be out of cache - are called over and over again. When I run the following command, the application starts running normally. system('RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8') Are the two the same, or is