subs.cpp
资源名称:shell.rar [点击查看]
上传用户:xhy777
上传日期:2007-02-14
资源大小:24088k
文件大小:1k
源码类别:
系统编程
开发平台:
Visual C++
- #include <windows.h>
- #include <wininet.h>
- void main()
- {
- // Assume existing file C:tempfoo.bar to be
- // committed to cache associated with
- // http://www.foo.bar/
- LPSTR szFile = "c:\temp\foo.bar";
- LPSTR szUrl = "http://www.foo.bar/";
- CHAR szCacheFile[MAX_PATH];
- // Expiry and Last-Modified times of 0.
- LONGLONG llZero = 0;
- FILETIME ftExpire = *((FILETIME*) & llZero);
- FILETIME ftLastMod = *((FILETIME*) & llZero);
- // Create cache file.
- CreateUrlCacheEntry(szUrl, 0, NULL, szCacheFile, 0);
- // Copy existing file to cache file.
- CopyFile(szFile, szCacheFile, FALSE);
- CommitUrlCacheEntry(szUrl,
- szCacheFile,
- ftExpire,
- ftLastMod,
- 0,
- NULL,
- 0,
- NULL,
- 0);
- }
English
