Jump to content

Delete temp file created with "Inetread"


Skitty
 Share

Recommended Posts

I have a script that reads an image from the internet using inetread, how can I identify the temporary file and delete it after storing the data to a variable?

The temporary file is seemingly generated with a random name...

Best bet would be to delete whole temp folder.

FileDelete(@TempDir & "\")
Edited by rogue5099
Link to comment
Share on other sites

I have a script that reads an image from the internet using inetread, how can I identify the temporary file and delete it after storing the data to a variable?

The temporary file is seemingly generated with a random name...

Better display the inetread script

So that members can help you

صرح السماء كان هنا

 

Link to comment
Share on other sites

It's just "Inetread", any time you use that command, a temp file is generated when doing so..

There is no information indicating Create a temporary file In AutoIt3Help

InetRead

http://www.autoitscript.com/autoit3/docs/functions/InetRead.htm

صرح السماء كان هنا

 

Link to comment
Share on other sites

I suppose this explanation for the options does hint about a local copy being stored: 1 = Forces a reload from the remote site. but I wasn't aware of it either.

A while ago there was an example script that would monitor a given drive, or folder for changes. You could monitor the temp folder for files being added when you call inetread and then compare the length, MD5, or anything else of those files to the downloaded data.

I'll see if I can find the topic.

Edit:

Edited by Tvern
Link to comment
Share on other sites

I just tested the Example for InetRead() and had the %TEMP% folder open and all that was created was an empty folder on Windows 7! I even tried with the Flag 1 so am a little confused to what file is created.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I suppose this explanation for the options does hint about a local copy being stored: 1 = Forces a reload from the remote site. but I wasn't aware of it either.

A while ago there was an example script that would monitor a given drive, or folder for changes. You could monitor the temp folder for files being added when you call inetread and then compare the length, MD5, or anything else of those files to the downloaded data.

I'll see if I can find the topic.

Edit:

Thank's! thats exactly what I needed to do!

Link to comment
Share on other sites

I just tested the Example for InetRead() and had the %TEMP% folder open and all that was created was an empty folder on Windows 7! I even tried with the Flag 1 so am a little confused to what file is created.

Same here. It just creates a folder called "Low" for me.
Link to comment
Share on other sites

Use this code

#include <Math.au3>
$jDll = DllOpen("Wininet.dll")

$Buffer = Inet_Read("http://www.win-rar.com/downloads/rar/wrar393.exe",100)
$Of = FileOpen("wrar393.exe",2)
FileWrite($Of,Binary(DllStructGetData($Buffer,1)))
FileClose($Of)

Func Inet_Read($lpszUrl,$ByteAtaTime)
if ($ByteAtaTime <= 0) Then Return SetError(1,0,0)
$HIntOpen = InternetOpen("OPEN")
if Not ($HIntOpen) Then Return SetError(2,0,0)
$HIntOpenUrl = InternetOpenUrl($HIntOpen,$lpszUrl,"",0,0,0)
if Not ($HIntOpenUrl) Then Return SetError(3,0,0)
$FileSize = HttpQueryInfo($HIntOpenUrl,5)
if @error Then Return SetError(4,0,0)
$Buffer = DllStructCreate("BYTE[" & $FileSize & "]")
$lpBuffer = DllStructGetPtr($Buffer)
Local $MovePos = 0
$FileSize = Number($FileSize)
While 1
$OutPtr = $lpBuffer + $MovePos
$dwNumberOfBytesToRead = _Min($ByteAtaTime,$FileSize - $MovePos);
$lpdwNumberOfBytesRead = InternetReadFile($HIntOpenUrl,$OutPtr,$dwNumberOfBytesToRead)
$error = @error
if $error Or $lpdwNumberOfBytesRead <= 0 Then ExitLoop
$MovePos += $lpdwNumberOfBytesRead
WEnd
if ($error) Then $error = 5
InternetCloseHandle($HIntOpen)
InternetCloseHandle($HIntOpenUrl)
Return SetError($error,0,$Buffer)
EndFunc

Func InternetReadFile($hFile,$lpBuffer,$dwNumberOfBytesToRead)
$DLLSDWORD = DllStructCreate("DWORD")
$lpdwNumberOfBytesRead = DllStructGetPtr($DLLSDWORD)
$BOOL = DllCall($jDll,"BOOL","InternetReadFile","HANDLE",$hFile,"ptr",$lpBuffer, _
"DWORD",$dwNumberOfBytesToRead,"ptr",$lpdwNumberOfBytesRead)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,DllStructGetData($DLLSDWORD,1))
EndFunc

Func HttpQueryInfo($hRequest,$dwInfoLevel,$lpdwIndex = 0)
Local $lpdwBufferLength = 1000
$DLLSDWORD = DllStructCreate("DWORD")
DllStructSetData($DLLSDWORD,1,$lpdwBufferLength)
$LPDWORDLENGTH = DllStructGetPtr($DLLSDWORD)
$DLLSlpvBuffer = DllStructCreate("WCHAR[" & $lpdwBufferLength & "]")
$lpvBuffer = DllStructGetPtr($DLLSlpvBuffer)
$BOOL = DllCall($jDll,"BOOL","HttpQueryInfoW","HANDLE",$hRequest,"DWORD",$dwInfoLevel, _
"ptr",$lpvBuffer,"ptr",$LPDWORDLENGTH,"DWORD",$lpdwIndex)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,DllStructGetData($DLLSlpvBuffer,1))
EndFunc

Func InternetOpenUrl($hInternet,$lpszUrl,$lpszHeaders,$dwHeadersLength,$dwFlags,$dwContext)
$HINTERNET = DllCall($jDll,"HANDLE","InternetOpenUrlW","HANDLE",$hInternet,"wstr",$lpszUrl, _
"wstr",$lpszHeaders,"DWORD",$dwHeadersLength,"DWORD",$dwFlags,"ptr",$dwContext)
if @error Then Return SetError(1,0,0)
if Not ($HINTERNET[0]) Then Return SetError(2,0,0)
Return SetError(0,0,$HINTERNET[0])
EndFunc

Func InternetOpen($lpszAgent,$dwAccessType = 0,$lpszProxyName = "",$lpszProxyBypass = "",$dwFlags = 0)
$HINTERNET = DllCall($jDll,"HANDLE","InternetOpenW","wstr",$lpszAgent,"DWORD",$dwAccessType, _
"wstr",$lpszProxyName,"wstr",$lpszProxyBypass,"DWORD",$dwFlags)
if @error Then Return SetError(1,0,0)
if Not ($HINTERNET[0]) Then Return SetError(2,0,0)
Return SetError(0,0,$HINTERNET[0])
EndFunc

Func InternetCloseHandle($hInternet)
$BOOL = DllCall($jDll,"BOOL","InternetCloseHandle","HANDLE",$hInternet)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,$BOOL[0])
EndFunc
Edited by wolf9228

صرح السماء كان هنا

 

Link to comment
Share on other sites

Use this code

#include <Math.au3>
$jDll = DllOpen("Wininet.dll")

$Buffer = Inet_Read("http://www.win-rar.com/downloads/rar/wrar393.exe",100)
$Of = FileOpen("wrar393.exe",2)
FileWrite($Of,Binary(DllStructGetData($Buffer,1)))
FileClose($Of)

Func Inet_Read($lpszUrl,$ByteAtaTime)
$HIntOpen = InternetOpen("OPEN")
if Not ($HIntOpen) Then Return SetError(1,0,0)
$HIntOpenUrl = InternetOpenUrl($HIntOpen,$lpszUrl,"",0,0,0)
if Not ($HIntOpenUrl) Then Return SetError(2,0,0)
$FileSize = HttpQueryInfo($HIntOpenUrl,5)
if @error Then Return SetError(3,0,0)
$Buffer = DllStructCreate("BYTE[" & $FileSize & "]")
$lpBuffer = DllStructGetPtr($Buffer)
Local $MovePos = 0
$FileSize = Number($FileSize)
While 1
$OutPtr = $lpBuffer + $MovePos
$dwNumberOfBytesToRead = _Min($ByteAtaTime,$FileSize - $MovePos);
$lpdwNumberOfBytesRead = InternetReadFile($HIntOpenUrl,$OutPtr,$dwNumberOfBytesToRead)
if @error Or $lpdwNumberOfBytesRead <= 0 Then ExitLoop
$MovePos += $lpdwNumberOfBytesRead
WEnd
InternetCloseHandle($HIntOpen)
InternetCloseHandle($HIntOpenUrl)
Return SetError(3,0,$Buffer)
EndFunc

Func InternetReadFile($hFile,$lpBuffer,$dwNumberOfBytesToRead)
$DLLSDWORD = DllStructCreate("DWORD")
$lpdwNumberOfBytesRead = DllStructGetPtr($DLLSDWORD)
$BOOL = DllCall($jDll,"BOOL","InternetReadFile","HANDLE",$hFile,"ptr",$lpBuffer, _
"DWORD",$dwNumberOfBytesToRead,"ptr",$lpdwNumberOfBytesRead)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,DllStructGetData($DLLSDWORD,1))
EndFunc

Func HttpQueryInfo($hRequest,$dwInfoLevel,$lpdwIndex = 0)
Local $lpdwBufferLength = 1000
$DLLSDWORD = DllStructCreate("DWORD")
DllStructSetData($DLLSDWORD,1,$lpdwBufferLength)
$LPDWORDLENGTH = DllStructGetPtr($DLLSDWORD)
$DLLSlpvBuffer = DllStructCreate("WCHAR[" & $lpdwBufferLength & "]")
$lpvBuffer = DllStructGetPtr($DLLSlpvBuffer)
$BOOL = DllCall($jDll,"BOOL","HttpQueryInfoW","HANDLE",$hRequest,"DWORD",$dwInfoLevel, _
"ptr",$lpvBuffer,"ptr",$LPDWORDLENGTH,"DWORD",$lpdwIndex)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,DllStructGetData($DLLSlpvBuffer,1))
EndFunc



Func InternetOpenUrl($hInternet,$lpszUrl,$lpszHeaders,$dwHeadersLength,$dwFlags,$dwContext)
$HINTERNET = DllCall($jDll,"HANDLE","InternetOpenUrlW","HANDLE",$hInternet,"wstr",$lpszUrl, _
"wstr",$lpszHeaders,"DWORD",$dwHeadersLength,"DWORD",$dwFlags,"ptr",$dwContext)
if @error Then Return SetError(1,0,0)
if Not ($HINTERNET[0]) Then Return SetError(2,0,0)
Return SetError(0,0,$HINTERNET[0])
EndFunc



Func InternetOpen($lpszAgent,$dwAccessType = 0,$lpszProxyName = "",$lpszProxyBypass = "",$dwFlags = 0)
$HINTERNET = DllCall($jDll,"HANDLE","InternetOpenW","wstr",$lpszAgent,"DWORD",$dwAccessType, _
"wstr",$lpszProxyName,"wstr",$lpszProxyBypass,"DWORD",$dwFlags)
if @error Then Return SetError(1,0,0)
if Not ($HINTERNET[0]) Then Return SetError(2,0,0)
Return SetError(0,0,$HINTERNET[0])
EndFunc

Func InternetCloseHandle($hInternet)
$BOOL = DllCall($jDll,"BOOL","InternetCloseHandle","HANDLE",$hInternet)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,$BOOL[0])
EndFunc

Posted Image what happens when I run it? aside from downloading winrar.
Link to comment
Share on other sites

Posted Image what happens when I run it? aside from downloading winrar.

Nothing. That's the point I think. (Nothing, as in no temp file seems to be created on first glance)

Edit: Seems a bit overkill to include <Math.au3> just to use _Min() once. I'd replace it with:

If $ByteAtaTime < $FileSize - $MovePos Then
            $dwNumberOfBytesToRead = $ByteAtaTime
        Else
            $dwNumberOfBytesToRead = $FileSize - $MovePos
        EndIf
Edited by Tvern
Link to comment
Share on other sites

Posted Image what happens when I run it? aside from downloading winrar.

WinINet Functions

http://msdn.microsoft.com/en-us/library/aa385473%28v=VS.85%29.aspx

InternetOpen Function

Initializes an application's use of the WinINet functions.

InternetOpen is the first WinINet function called by an application. It tells the Internet DLL to initialize internal data structures and prepare for future calls from the application.

InternetOpenUrl Function

Opens a resource specified by a complete FTP or HTTP URL.

The InternetOpenUrl function parses the URL string, establishes a connection to the server, and prepares to download the data identified by the URL.

HttpQueryInfo Function

Retrieves header information associated with an HTTP request.

dwInfoLevel [in]

Combination of an attribute to be retrieved and flags that modify the request. For a list of possible attribute and modifier values, see Query Info Flags.

The following lists contain the attributes and modifiers used by HttpQueryInfo and QueryInfo.

The attribute flags are used by HttpQueryInfo (or QueryInfo) to indicate what data to retrieve. Most of the attribute flags map directly to a specific HTTP header. There are also some special flags, such as HTTP_QUERY_RAW_HEADERS, that are not related to a specific header.

HTTP_QUERY_ACCEPT

24

Retrieves the acceptable media types for the response.

HTTP_QUERY_ACCEPT_CHARSET

25

Retrieves the acceptable character sets for the response.

HTTP_QUERY_ACCEPT_ENCODING

26

Retrieves the acceptable content-coding values for the response.

HTTP_QUERY_ACCEPT_LANGUAGE

27

Retrieves the acceptable natural languages for the response.

HTTP_QUERY_ACCEPT_RANGES

42

Retrieves the types of range requests that are accepted for a resource.

HTTP_QUERY_AGE

48

Retrieves the Age response-header field, which contains the sender's estimate of the amount of time since the response was generated at the origin server.

HTTP_QUERY_ALLOW

7

Receives the HTTP verbs supported by the server.

HTTP_QUERY_AUTHORIZATION

28

Retrieves the authorization credentials used for a request.

HTTP_QUERY_CACHE_CONTROL

49

Retrieves the cache control directives.

HTTP_QUERY_CONNECTION

23

Retrieves any options that are specified for a particular connection and must not be communicated by proxies over further connections.

HTTP_QUERY_CONTENT_BASE

50

Retrieves the base URI (Uniform Resource Identifier) for resolving relative URLs within the entity.

HTTP_QUERY_CONTENT_DESCRIPTION

4

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_CONTENT_DISPOSITION

47

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_CONTENT_ENCODING

29

Retrieves any additional content codings that have been applied to the entire resource.

HTTP_QUERY_CONTENT_ID

3

Retrieves the content identification.

HTTP_QUERY_CONTENT_LANGUAGE

6

Retrieves the language that the content is in.

HTTP_QUERY_CONTENT_LENGTH

5

Retrieves the size of the resource, in bytes.

HTTP_QUERY_CONTENT_LOCATION

51

Retrieves the resource location for the entity enclosed in the message.

HTTP_QUERY_CONTENT_MD5

52

Retrieves an MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) for the entity-body. For more information, see RFC1864, The Content-MD5 Header Field, at http://ftp.isi.edu/in-notes/rfc1864.txt.

HTTP_QUERY_CONTENT_RANGE

53

Retrieves the location in the full entity-body where the partial entity-body should be inserted and the total size of the full entity-body.

HTTP_QUERY_CONTENT_TRANSFER_ENCODING

2

Receives the additional content coding that has been applied to the resource.

HTTP_QUERY_CONTENT_TYPE

1

Receives the content type of the resource (such as text/html).

HTTP_QUERY_COOKIE

44

Retrieves any cookies associated with the request.

HTTP_QUERY_COST

15

No longer supported.

HTTP_QUERY_CUSTOM

65535

Causes HttpQueryInfo to search for the header name specified in lpvBuffer and store the header data in lpvBuffer.

HTTP_QUERY_DATE

9

Receives the date and time at which the message was originated.

HTTP_QUERY_DERIVED_FROM

14

No longer supported.

HTTP_QUERY_ECHO_HEADERS

73

Not currently implemented.

HTTP_QUERY_ECHO_HEADERS_CRLF

74

Not currently implemented.

HTTP_QUERY_ECHO_REPLY

72

Not currently implemented.

HTTP_QUERY_ECHO_REQUEST

71

Not currently implemented.

HTTP_QUERY_ETAG

54

Retrieves the entity tag for the associated entity.

HTTP_QUERY_EXPECT

68

Retrieves the Expect header, which indicates whether the client application should expect 100 series responses.

HTTP_QUERY_EXPIRES

10

Receives the date and time after which the resource should be considered outdated.

HTTP_QUERY_FORWARDED

30

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_FROM

31

Retrieves the e-mail address for the human user who controls the requesting user agent if the From header is given.

HTTP_QUERY_HOST

55

Retrieves the Internet host and port number of the resource being requested.

HTTP_QUERY_IF_MATCH

56

Retrieves the contents of the If-Match request-header field.

HTTP_QUERY_IF_MODIFIED_SINCE

32

Retrieves the contents of the If-Modified-Since header.

HTTP_QUERY_IF_NONE_MATCH

57

Retrieves the contents of the If-None-Match request-header field.

HTTP_QUERY_IF_RANGE

58

Retrieves the contents of the If-Range request-header field. This header enables the client application to verify that the entity related to a partial copy of the entity in the client application cache has not been updated. If the entity has not been updated, send the parts that the client application is missing. If the entity has been updated, send the entire updated entity.

HTTP_QUERY_IF_UNMODIFIED_SINCE

59

Retrieves the contents of the If-Unmodified-Since request-header field.

HTTP_QUERY_LAST_MODIFIED

11

Receives the date and time at which the server believes the resource was last modified.

HTTP_QUERY_LINK

16

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_LOCATION

33

Retrieves the absolute Uniform Resource Identifier (URI) used in a Location response-header.

HTTP_QUERY_MAX

78

Not a query flag. Indicates the maximum value of an HTTP_QUERY_* value.

HTTP_QUERY_MAX_FORWARDS

60

Retrieves the number of proxies or gateways that can forward the request to the next inbound server.

HTTP_QUERY_MESSAGE_ID

12

No longer supported.

HTTP_QUERY_MIME_VERSION

0

Receives the version of the MIME protocol that was used to construct the message.

HTTP_QUERY_ORIG_URI

34

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_PRAGMA

17

Receives the implementation-specific directives that might apply to any recipient along the request/response chain.

HTTP_QUERY_PROXY_AUTHENTICATE

41

Retrieves the authentication scheme and realm returned by the proxy.

HTTP_QUERY_PROXY_AUTHORIZATION

61

Retrieves the header that is used to identify the user to a proxy that requires authentication. This header can only be retrieved before the request is sent to the server.

HTTP_QUERY_PROXY_CONNECTION

69

Retrieves the Proxy-Connection header.

HTTP_QUERY_PUBLIC

8

Receives methods available at this server.

HTTP_QUERY_RANGE

62

Retrieves the byte range of an entity.

HTTP_QUERY_RAW_HEADERS

21

Receives all the headers returned by the server. Each header is terminated by "\0". An additional "\0" terminates the list of headers.

HTTP_QUERY_RAW_HEADERS_CRLF

22

Receives all the headers returned by the server. Each header is separated by a carriage return/line feed (CR/LF) sequence.

HTTP_QUERY_REFERER

35

Receives the Uniform Resource Identifier (URI) of the resource where the requested URI was obtained.

HTTP_QUERY_REFRESH

46

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_REQUEST_METHOD

45

Receives the HTTP verb that is being used in the request, typically GET or POST.

HTTP_QUERY_RETRY_AFTER

36

Retrieves the amount of time the service is expected to be unavailable.

HTTP_QUERY_SERVER

37

Retrieves data about the software used by the origin server to handle the request.

HTTP_QUERY_SET_COOKIE

43

Receives the value of the cookie set for the request.

HTTP_QUERY_STATUS_CODE

19

Receives the status code returned by the server. For more information and a list of possible values, see HTTP Status Codes.

HTTP_QUERY_STATUS_TEXT

20

Receives any additional text returned by the server on the response line.

HTTP_QUERY_TITLE

38

Obsolete. Maintained for legacy application compatibility only.

HTTP_QUERY_TRANSFER_ENCODING

63

Retrieves the type of transformation that has been applied to the message body so it can be safely transferred between the sender and recipient.

HTTP_QUERY_UNLESS_MODIFIED_SINCE

70

Retrieves the Unless-Modified-Since header.

HTTP_QUERY_UPGRADE

64

Retrieves the additional communication protocols that are supported by the server.

HTTP_QUERY_URI

13

Receives some or all of the Uniform Resource Identifiers (URIs) by which the Request-URI resource can be identified.

HTTP_QUERY_USER_AGENT

39

Retrieves data about the user agent that made the request.

HTTP_QUERY_VARY

65

Retrieves the header that indicates that the entity was selected from a number of available representations of the response using server-driven negotiation.

HTTP_QUERY_VERSION

18

Receives the last response code returned by the server.

HTTP_QUERY_VIA

66

Retrieves the intermediate protocols and recipients between the user agent and the server on requests, and between the origin server and the client on responses.

HTTP_QUERY_WARNING

67

Retrieves additional data about the status of a response that might not be reflected by the response status code.

HTTP_QUERY_WWW_AUTHENTICATE

40

Retrieves the authentication scheme and realm returned by the server.

HTTP_QUERY_X_CONTENT_TYPE_OPTIONS

79

Retrieves the X-Content-Type-Options header value.

HTTP_QUERY_P3P

80

Retrieves the P3P header value.

HTTP_QUERY_X_P2P_PEERDIST

81

Retrieves the X-P2P-PeerDist header value.

HTTP_QUERY_TRANSLATE

82

Retrieves the translate header value.

HTTP_QUERY_X_UA_COMPATIBLE

83

Retrieves the X-UA-Compatible header value.

HTTP_QUERY_DEFAULT_STYLE

84

Retrieves the Default-Style header value.

HTTP_QUERY_X_FRAME_OPTIONS

85

Retrieves the X-Frame-Options header value.

HTTP_QUERY_X_XSS_PROTECTION

86

Retrieves the X-XSS-Protection header value.

The modifier flags are used in conjunction with an attribute flag to modify the request. Modifier flags either modify the format of the data returned or indicate where HttpQueryInfo (or QueryInfo) should search for the data.

HTTP_QUERY_FLAG_COALESCE

0x10000000

Not implemented.

HTTP_QUERY_FLAG_NUMBER

0x20000000

Returns the data as a 32-bit number for headers whose value is a number, such as the status code.

HTTP_QUERY_FLAG_REQUEST_HEADERS

0x80000000

Queries request headers only.

HTTP_QUERY_FLAG_SYSTEMTIME

0x40000000

Returns the header value as a SYSTEMTIME structure, which does not require the application to parse the data. Use for headers whose value is a date/time string, such as "Last-Modified-Time".

InternetReadFile Function

Reads data from a handle opened by the InternetOpenUrl, FtpOpenFile, or HttpOpenRequest function.

InternetReadFile operates much like the base ReadFile function, with a few exceptions. Typically, InternetReadFile retrieves data from an HINTERNET handle as a sequential stream of bytes. The amount of data to be read for each call to InternetReadFile is specified by the dwNumberOfBytesToRead parameter and the data is returned in the lpBuffer parameter. A normal read retrieves the specified dwNumberOfBytesToRead for each call to InternetReadFile until the end of the file is reached. To ensure all data is retrieved, an application must continue to call the InternetReadFile function until the function returns TRUE and the lpdwNumberOfBytesRead parameter equals zero. This is especially important if the requested data is written to the cache, because otherwise the cache will not be properly updated and the file downloaded will not be committed to the cache. Note that caching happens automatically unless the original request to open the data stream set the INTERNET_FLAG_NO_CACHE_WRITE flag.

Edited by wolf9228

صرح السماء كان هنا

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...