CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VB >  API

如何获取当前用户IE临时文件夹的目录呀?

楼主3gw(人往高处走)2003-09-03 14:48:21 在 VB / API 提问

如何获取当前用户IE临时文件夹(Temporary   Internet   Files)的目录呀?  
   
  问题点数:10、回复次数:6Top

1 楼3gw(人往高处走)回复于 2003-09-03 14:50:14 得分 0

如何得到它的路径?Top

2 楼TechnoFantasy((VB MVP)www.applevb.com)回复于 2003-09-03 14:58:11 得分 0

Const   CSIDL_DESKTOP   =   &H0  
  Const   CSIDL_PROGRAMS   =   &H2  
  Const   CSIDL_CONTROLS   =   &H3  
  Const   CSIDL_PRINTERS   =   &H4  
  Const   CSIDL_PERSONAL   =   &H5  
  Const   CSIDL_FAVORITES   =   &H6  
  Const   CSIDL_STARTUP   =   &H7  
  Const   CSIDL_RECENT   =   &H8  
  Const   CSIDL_SENDTO   =   &H9  
  Const   CSIDL_BITBUCKET   =   &HA  
  Const   CSIDL_STARTMENU   =   &HB  
  Const   CSIDL_DESKTOPDIRECTORY   =   &H10  
  Const   CSIDL_DRIVES   =   &H11  
  Const   CSIDL_NETWORK   =   &H12  
  Const   CSIDL_NETHOOD   =   &H13  
  Const   CSIDL_FONTS   =   &H14  
  Const   CSIDL_TEMPLATES   =   &H15  
  Const   MAX_PATH   =   260  
  Private   Type   SHITEMID  
          cb   As   Long  
          abID   As   Byte  
  End   Type  
  Private   Type   ITEMIDLIST  
          mkid   As   SHITEMID  
  End   Type  
  Private   Declare   Function   ShellAbout   Lib   "shell32.dll"   Alias   "ShellAboutA"   (ByVal   hWnd   As   Long,   ByVal   szApp   As   String,   ByVal   szOtherStuff   As   String,   ByVal   hIcon   As   Long)   As   Long  
  Private   Declare   Function   SHGetSpecialFolderLocation   Lib   "shell32.dll"   (ByVal   hwndOwner   As   Long,   ByVal   nFolder   As   Long,   pidl   As   ITEMIDLIST)   As   Long  
  Private   Declare   Function   SHGetPathFromIDList   Lib   "shell32.dll"   Alias   "SHGetPathFromIDListA"   (ByVal   pidl   As   Long,   ByVal   pszPath   As   String)   As   Long  
  Private   Sub   Form_Load()  
          'Show   an   about   window  
          ShellAbout   Me.hWnd,   App.Title,   "   ",   ByVal   0&  
          'Set   the   graphical   mode   to   persistent  
          Me.AutoRedraw   =   True  
          'Print   the   folders   to   the   form  
          Me.Print   "Start   menu   folder:   "   +   GetSpecialfolder(CSIDL_STARTMENU)  
          Me.Print   "Favorites   folder:   "   +   GetSpecialfolder(CSIDL_FAVORITES)  
          Me.Print   "Programs   folder:   "   +   GetSpecialfolder(CSIDL_PROGRAMS)  
          Me.Print   "Desktop   folder:   "   +   GetSpecialfolder(CSIDL_DESKTOP)  
  End   Sub  
  Private   Function   GetSpecialfolder(CSIDL   As   Long)   As   String  
          Dim   r   As   Long  
          Dim   IDL   As   ITEMIDLIST  
          'Get   the   special   folder  
          r   =   SHGetSpecialFolderLocation(100,   CSIDL,   IDL)  
          If   r   =   NOERROR   Then  
                  'Create   a   buffer  
                  Path$   =   Space$(512)  
                  'Get   the   path   from   the   IDList  
                  r   =   SHGetPathFromIDList(ByVal   IDL.mkid.cb,   ByVal   Path$)  
                  'Remove   the   unnecessary   chr$(0)'s  
                  GetSpecialfolder   =   Left$(Path,   InStr(Path,   Chr$(0))   -   1)  
                  Exit   Function  
          End   If  
          GetSpecialfolder   =   ""  
  End   Function  
  Top

3 楼yijiansong(不知路在何方)回复于 2003-09-03 15:40:16 得分 0

找找API帮助,应该有的Top

4 楼lwm1977(大维)回复于 2003-09-03 16:31:34 得分 0

读取注册表Top

5 楼lwm1977(大维)回复于 2003-09-03 16:33:42 得分 10

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell   Folders]  
  "Cache"="C:\\WINDOWS\\Temporary   Internet   Files"  
  Top

6 楼hxy2003(asfd)回复于 2003-09-04 09:20:15 得分 0

就上面的代码。Top

相关问题

  • 如何把文件考进ie的临时文件夹
  • 问:VBS删除IE临时文件夹中文件
  • 临时文件夹问题
  • 请教如何获取ie临时文件夹中的文件名,谢谢
  • 问:怎样取得IE存放网页的临时文件夹的路径?
  • 如何获得IE临时文件夹中文件的"Internet地址"属性?
  • 如何删除Temporary Internet Files中的ie临时文件夹中的临时文件?
  • 临时文件夹拒绝访问
  • 如何获得COOKIES文件夹目录
  • IE的临时文件夹的大小在注册表里,真的很难设置。想请教。

关键词

  • desktop
  • me
  • shell
  • csidl
  • getspecialfolder
  • const csidl
  • folders
  • itemidlist
  • byval
  • favorites

得分解答快速导航

  • 帖主:3gw
  • lwm1977

相关链接

  • Visual Basic类图书
  • Visual Basic类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo