ipad第一次连接电脑误选打开internal storage为空,以后就总是直接打开internal storage为空,怎么清除打开方式?

iphone5s连接到电脑,除了大家都知道的一个internal storage_iphone5s吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:1,434,740贴子:
iphone5s连接到电脑,除了大家都知道的一个internal storage收藏
iphone5s连接到电脑,除了大家都知道的一个internal storage,还有一个银盘一样的图标,但是无法打开,大家不知道有没有的呢?
苏宁易购手机,给力大促,狂欢到底,全国联保,服务一站式,体验心动购物!苏宁易购手机,支持货到付款,让您省钱更省心!
没有人哦?
同疑问,我的internal storage是空白..
登录百度帐号Next Article in Journal
Next Article in Special Issue
Previous Article in Journal
Previous Article in Special Issue
Choose your preferred view mode
Please select whether you prefer to view the MDPI pages with a view tailored for mobile displays or to view the MDPI
pages in the normal scrollable desktop version. This selection will be stored into your cookies and used automatically
in next visits. You can also change the view style at any point from the main header when using the pages with your
mobile device.
You seem to have javascript disabled. Please note that many of the page functionalities won't work as expected without javascript enabled.
MDPI & Materials
Article Versions
Related Info
More by Authors
Export Article
Create a SciFeed alert for new publications
With following keywords
hydride electrode
hydrogen storage
fuel cell anode
thermal desorption spectrometry
By following authors
Rui F. M. Lobo
Diogo M. F. Santos
Cesar A. C. Sequeira
Jorge H. F. Ribeiro
One email with all search results
One email for each search
MOL Viewer
Open AccessArticle
Materials 2012, 5(2), 248-257;
Molecular Beam-Thermal Desorption Spectrometry (MB-TDS) Monitoring of Hydrogen Desorbed from Storage Fuel Cell Anodes
ICEMS, IST/UTL, Av. Rovisco Pais, Lisboa , Portugal
Nanoscale Science Group (GNCN), Physics Department, FCT/UNL, Caparica , Portugal
Author to whom correspondence should be addressed.
Received: 22 December 2011 / Revised: 28 January 2012 / Accepted: 31 January 2012 / Published: 6 February 2012
(This article belongs to the
Special Issue )
[386 KB, uploaded 6 February 2012]
Abstract Different types of experimental studies are performed using the hydrogen storage alloy (HSA) MlNi3.6Co0.85Al0.3Mn0.3 (Ml: La-rich mischmetal), chemically surface treated, as the anode active material for application in a proton exchange membrane fuel cell (PEMFC). The recently developed molecular beam—thermal desorption spectrometry (MB-TDS) technique is here reported for detecting the electrochemical hydrogen uptake and release by the treated HSA. The MB-TDS allows an accurate determination of the hydrogen mass absorbed into the hydrogen storage alloy (HSA), and has significant advantages in comparison with the conventional TDS method. Experimental data has revealed that the membrane electrode assembly (MEA) using such chemically treated alloy presents an enhanced surface capability for hydrogen adsorption.
This is an open access article distributed under the
(CC BY 3.0).
Share & Cite This Article
MDPI and ACS Style
Lobo, R.F.M.;
Santos, D.M.F.;
Sequeira, C.A.C.;
Ribeiro, J.H.F.
Molecular Beam-Thermal Desorption Spectrometry (MB-TDS) Monitoring of Hydrogen Desorbed from Storage Fuel Cell Anodes. Materials 2012, 5, 248-257.
Santos DMF,
Sequeira CAC,
Ribeiro JHF.
Molecular Beam-Thermal Desorption Spectrometry (MB-TDS) Monitoring of Hydrogen Desorbed from Storage Fuel Cell Anodes. Materials. ):248-257.
Chicago/Turabian Style
Lobo, Rui F. M.;
Santos, Diogo M. F.;
Sequeira, Cesar A. C.;
Ribeiro, Jorge H. F.
2012. "Molecular Beam-Thermal Desorption Spectrometry (MB-TDS) Monitoring of Hydrogen Desorbed from Storage Fuel Cell Anodes." Materials 5, no. 2: 248-257.
Find Other Styles
Related Articles
Article Metrics
For more information on the journal statistics, click .
Multiple requests from the same IP address are counted as one view.
Article Access Statistics
Only visits after 24 November 2015 are recorded.
MDPI Initiatives
Follow MDPIIn the Library of Windows Media Player you can select one or more music files. You can then right-click and in their context menu choose Open File Location. This will open up one windows explorer window for each directory that the files are in, and the files will be selected for you.
So let's say we have a bunch of mp3 files in our library where three of them are these:
Z:\Music\Thursday Blues\01. I wish it was friday.mp3
Z:\Music\Counting Sheep\01. Sheep #1.mp3
Z:\Music\Counting Sheep\02. Sheep #2.mp3
If we select those three (in a view where all of them are visible) and do Open File Location then two explorer windows will pop up. One will be the Z:\Music\Thursday Blues folder with 01. I wish it was friday.mp3 selected, and the other one will be the *Z:\Music\Counting Sheep** folder with both 01. Sheep #1.mp3 and 02. Sheep #2.mp3 selected.
How can I do this myself in C#? We have an application which is going to export data to various formats, for example CSV and Excel, and I would like to open up explorer windows with these files selected when they are created and ready to be viewed. Currently I just do Process.Start(path), and this works but I would love to be able to highlight those particular files as well. Would make the files that were just created much more obvious.
Windows Media Player does it so well... I want to do it too =/ Are there any Microsoft employees here that could figure out how it can be done? (A)
解决方案 Searching for an answer after a coworker had the issue i found none so i wrote a small class to do this. The code
and i will paste the curent version at the end of this post.
With your sample files, the syntax will be :
ShowSelectedInExplorer.FilesOrFolders(
@"Z:\Music\Thursday Blues\01. I wish it was friday.mp3",
@"Z:\Music\Counting Sheep\01. Sheep #1.mp3",
@"Z:\Music\Counting Sheep\02. Sheep #2.mp3"
There are some limitations to my code compared to the low level API, mainly :
Selecting on the desktop is not implemented
The parent directory must be a directory or a drive, so you can't select multiple drives in the My Computer folder for example.
Anyway, here is the ShowSelectedInExplorer class source code :
namespace SHOpenFolderAndSelectItems
using System.Collections.G
using System.IO;
using System.L
using System.Runtime.CompilerS
using System.Runtime.InteropS
using System.Runtime.InteropServices.ComT
static class ShowSelectedInExplorer
enum SHCONT : ushort
SHCONTF_CHECKING_FOR_CHILDREN = 0x0010,
SHCONTF_FOLDERS = 0x0020,
SHCONTF_NONFOLDERS = 0x0040,
SHCONTF_INCLUDEHIDDEN = 0x0080,
SHCONTF_INIT_ON_FIRST_NEXT = 0x0100,
SHCONTF_NETPRINTERSRCH = 0x0200,
SHCONTF_SHAREABLE = 0x0400,
SHCONTF_STORAGE = 0x0800,
SHCONTF_NAVIGATION_ENUM = 0x1000,
SHCONTF_FASTITEMS = 0x2000,
SHCONTF_FLATLIST = 0x4000,
SHCONTF_ENABLE_ASYNC = 0x8000
[ComImport,
Guid("--C000-"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
ComConversionLoss]
interface IShellFolder
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void ParseDisplayName(IntPtr hwnd, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In, MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName, [Out] out uint pchEaten, [Out] out IntPtr ppidl, [In, Out] ref uint pdwAttributes);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int EnumObjects([In] IntPtr hwnd, [In] SHCONT grfFlags, [MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenumIDList);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int BindToObject([In] IntPtr pidl, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void BindToStorage([In] ref IntPtr pidl, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In] ref Guid riid, out IntPtr ppv);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void CompareIDs([In] IntPtr lParam, [In] ref IntPtr pidl1, [In] ref IntPtr pidl2);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void CreateViewObject([In] IntPtr hwndOwner, [In] ref Guid riid, out IntPtr ppv);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void GetAttributesOf([In] uint cidl, [In] IntPtr apidl, [In, Out] ref uint rgfInOut);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void GetUIObjectOf([In] IntPtr hwndOwner, [In] uint cidl, [In] IntPtr apidl, [In] ref Guid riid, [In, Out] ref uint rgfReserved, out IntPtr ppv);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void GetDisplayNameOf([In] ref IntPtr pidl, [In] uint uFlags, out IntPtr pName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void SetNameOf([In] IntPtr hwnd, [In] ref IntPtr pidl, [In, MarshalAs(UnmanagedType.LPWStr)] string pszName, [In] uint uFlags, [Out] IntPtr ppidlOut);
[ComImport,
Guid("--C000-"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IEnumIDList
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int Next(uint celt, IntPtr rgelt, out uint pceltFetched);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int Skip([In] uint celt);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int Reset();
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int Clone([MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenum);
static class NativeMethods
[DllImport("shell32.dll", EntryPoint = "SHGetDesktopFolder", CharSet = CharSet.Unicode,
SetLastError = true)]
static extern int SHGetDesktopFolder_([MarshalAs(UnmanagedType.Interface)] out IShellFolder ppshf);
public static IShellFolder SHGetDesktopFolder()
Marshal.ThrowExceptionForHR(SHGetDesktopFolder_(out result));
[DllImport("shell32.dll", EntryPoint = "SHOpenFolderAndSelectItems")]
static extern int SHOpenFolderAndSelectItems_(
[In] IntPtr pidlFolder, uint cidl, [In, Optional, MarshalAs(UnmanagedType.LPArray)] IntPtr[] apidl,
int dwFlags);
public static void SHOpenFolderAndSelectItems(IntPtr pidlFolder, IntPtr[] apidl, int dwFlags)
var cidl = (apidl != null) ? (uint)apidl.Length : 0U;
var result = SHOpenFolderAndSelectItems_(pidlFolder, cidl, apidl, dwFlags);
Marshal.ThrowExceptionForHR(result);
[DllImport("shell32.dll")]
public static extern void ILFree([In] IntPtr pidl);
static IntPtr GetShellFolderChildrenRelativePIDL(IShellFolder parentFolder, string displayName)
uint pdwAttributes = 0;
parentFolder.ParseDisplayName(IntPtr.Zero, null, displayName, out pchEaten, out ppidl, ref pdwAttributes);
static IntPtr PathToAbsolutePIDL(string path)
var desktopFolder = NativeMethods.SHGetDesktopFolder();
return GetShellFolderChildrenRelativePIDL(desktopFolder, path);
static Guid IID_IShellFolder = typeof(IShellFolder).GUID;
static IShellFolder PIDLToShellFolder(IShellFolder parent, IntPtr pidl)
var result = parent.BindToObject(pidl, null, ref IID_IShellFolder, out folder);
Marshal.ThrowExceptionForHR((int)result);
static IShellFolder PIDLToShellFolder(IntPtr pidl)
return PIDLToShellFolder(NativeMethods.SHGetDesktopFolder(), pidl);
static void SHOpenFolderAndSelectItems(IntPtr pidlFolder, IntPtr[] apidl, bool edit)
NativeMethods.SHOpenFolderAndSelectItems(pidlFolder, apidl, edit ? 1 : 0);
public static void FileOrFolder(string path, bool edit = false)
if (path == null) throw new ArgumentNullException("path");
var pidl = PathToAbsolutePIDL(path);
SHOpenFolderAndSelectItems(pidl, null, edit);
NativeMethods.ILFree(pidl);
static IEnumerable&FileSystemInfo& PathToFileSystemInfo(IEnumerable&string& paths)
foreach (var path in paths)
var fixedPath =
if (fixedPath.EndsWith(Path.DirectorySeparatorChar.ToString())
|| fixedPath.EndsWith(Path.AltDirectorySeparatorChar.ToString()))
fixedPath = fixedPath.Remove(fixedPath.Length - 1);
if (Directory.Exists(fixedPath))
yield return new DirectoryInfo(fixedPath);
else if (File.Exists(fixedPath))
yield return new FileInfo(fixedPath);
throw new FileNotFoundException
(string.Format("The specified file or folder doesn't exists : {0}", fixedPath),
fixedPath);
public static void FilesOrFolders(string parentDirectory, ICollection&string& filenames)
if (filenames == null) throw new ArgumentNullException("filenames");
if (filenames.Count == 0)
var parentPidl = PathToAbsolutePIDL(parentDirectory);
var parent = PIDLToShellFolder(parentPidl);
var filesPidl = filenames
.Select(filename =& GetShellFolderChildrenRelativePIDL(parent, filename))
.ToArray();
SHOpenFolderAndSelectItems(parentPidl, filesPidl, false);
foreach (var pidl in filesPidl)
NativeMethods.ILFree(pidl);
NativeMethods.ILFree(parentPidl);
public static void FilesOrFolders(params string[] paths)
FilesOrFolders((IEnumerable&string&)paths);
public static void FilesOrFolders(IEnumerable&string& paths)
if (paths == null) throw new ArgumentNullException("paths");
FilesOrFolders(PathToFileSystemInfo(paths));
public static void FilesOrFolders(IEnumerable&FileSystemInfo& paths)
if (paths == null) throw new ArgumentNullException("paths");
var pathsArray = paths.ToArray();
if (pathsArray.Count() == 0)
var explorerWindows = pathsArray.GroupBy(p =& Path.GetDirectoryName(p.FullName));
foreach (var explorerWindowPaths in explorerWindows)
var parentDirectory = Path.GetDirectoryName(explorerWindowPaths.First().FullName);
FilesOrFolders(parentDirectory, explorerWindowPaths.Select(fsi =& fsi.Name).ToList());
class Program
static void Main()
var test = 3;
switch (test)
var mydocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
ShowSelectedInExplorer.FileOrFolder(Path.Combine(mydocs, "Visual Studio 2010"), edit: true);
ShowSelectedInExplorer.FileOrFolder(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
ShowSelectedInExplorer.FilesOrFolders(@"C:\Windows\", new[] { "Microsoft.NET", "System32", "Setup" });
ShowSelectedInExplorer.FilesOrFolders(@"C:\Windows\Microsoft.NET\", @"C:\Windows\System32", @"C:\Windows\Setup", @"C:\Program Files");
本文地址: &
在Windows Media Player中的图书馆,您可以选择一个或多个音乐文件。然后,您可以单击鼠标右键,并在其上下文菜单中选择的打开文件位置的。这将打开一台Windows资源管理器窗口的每个文件都在目录中,文件将被选定为您服务。 所以我们可以说,我们在我们的图书馆一堆MP3文件,其中三人都是这些:的 Z:\\音乐\\周四蓝军\\ 01。我想这是friday.mp3 的的 Z:\\音乐\\数羊\\ 01。羊#1.MP3 的的 Z:\\音乐\\数羊\\ 02。羊#2.MP3 的如果我们选择这三个(在视图中,所有都是可见的),做的打开文件位置的那么双Explorer窗口将弹出。一会的的 Z:\\音乐\\周四蓝调的用的 01文件夹中。我想这是friday.mp3 的选择,其他人会成为* Z:\\音乐\\数羊**与两个文件夹中的 01。羊#1.MP3 和 02。羊#2.MP3 选择的。我怎样才能做到这一点我自己在C#中?我们有打算将数据导出到各种格式,比如CSV和Excel应用程序,我愿与创建并准备查看时,他们选择了这些文件,打开资源管理器窗口。目前,我只是做的Process.Start(路径),而这个工作,但我希望能够突出那些特定的文件。会提出这样刚刚创建更加明显。文件
Windows媒体播放器的这么好......我想做到这一点= /有没有这里的任何微软的员工,可以弄清楚它是如何做呢? (A)解决方案 搜索答案后,一位同事曾找不着,所以我写了一个小类来做到这一点的问题。在code ,我会粘贴CURENT版本在这篇文章的末尾。使用示例文件,语法是:
ShowSelectedInExplorer.FilesOrFolders(
@“Z:\\音乐\\周四蓝军\\ 01我想这是friday.mp3”
@“Z:\\音乐\\数羊\\ 01#羊1.MP3。”
@“Z:\\音乐\\数羊\\ 02#羊2.MP3。”
); 有我的$ C $一些限制则为C的底层API,主要是:选择在桌面上不落实的父目录必须是目录或驱动器,所以你不能选择我的电脑文件夹中的多个驱动器为例。总之,这里是ShowSelectedInExplorer类源$ C $ C: 命名空间SHOpenFolderAndSelectItems{
使用System.Collections.G
使用System.IO;
使用System.Linq的;
使用System.Runtime.CompilerS
使用System.Runtime.InteropS
使用System.Runtime.InteropServices.ComT
静态类ShowSelectedInExplorer
枚举SHCONT:USHORT
SHCONTF_CHECKING_FOR_CHILDREN = 0×0010,
SHCONTF_FOLDERS = 0×0020,
SHCONTF_NONFOLDERS =×0040,
SHCONTF_INCLUDEHIDDEN = 0x0080,
SHCONTF_INIT_ON_FIRST_NEXT = 0100,
SHCONTF_NETPRINTERSRCH = 0x0200,
SHCONTF_SHAREABLE = 0x0400的时候,
SHCONTF_STORAGE = 0x0800的,
SHCONTF_NAVIGATION_ENUM = 0x1000处,
SHCONTF_FASTITEMS =为0x2000,
SHCONTF_FLATLIST = 0x4000的,
SHCONTF_ENABLE_ASYNC = 0x8000的
[ComImport,
GUID(“--C000-”),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)
ComConversionLoss]
接口的IShellFolder
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效ParseDisplayName(IntPtr的HWND,[在,的MarshalAs(UnmanagedType.Interface)IBindCtx中国人民银行,[在,的MarshalAs(UnmanagedType.LPWStr)字符串pszDisplayName,[出]出UINT pchEaten,[出]出的IntPtr ppidl,[输入,输出]参考UINT pdwAttributes);
[preserveSig]
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
INT EnumObjects([IN] IntPtr的HWND,[IN] SHCONT grfFlags,[的MarshalAs(UnmanagedType.Interface)出IEnumIDList ppenumIDList);
[preserveSig]
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
INT BindToObject的([IN] IntPtr的PIDL,[在,的MarshalAs(UnmanagedType.Interface)IBindCtx中国人民银行[IN] REF的Guid RIID,[出,的MarshalAs(UnmanagedType.Interface)出来的IShellFolder PPV);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效BindToStorage([IN]参考IntPtr的PIDL,[在,的MarshalAs(UnmanagedType.Interface)IBindCtx中国人民银行[IN] REF的Guid RIID,出的IntPtr PPV);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效CompareIDs([IN] IntPtr的lParam的[在]裁判的IntPtr pidl1,[在]参考IntPtr的pidl2);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效CreateViewObject([IN]的IntPtr hwndOwner,[在] REF的Guid RIID,出的IntPtr PPV);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效GetAttributesOf([IN] UINT CIDL,[IN]的IntPtr apidl,[输入,输出] REF UINT rgfInOut);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效GetUIObjectOf([IN]的IntPtr hwndOwner,[中] UINT CIDL,[IN]的IntPtr apidl,[在] REF的Guid RIID,[输入,输出] REF UINT rgfReserved,出的IntPtr PPV);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效GetDisplayNameOf([IN]参考IntPtr的PIDL,[中] UINT和uFlags,出的IntPtr PNAME);
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
无效SetNameOf([IN] IntPtr的HWND,[在]参考IntPtr的PIDL,[在,的MarshalAs(UnmanagedType.LPWStr)字符串pszName,[中] UINT和uFlags,[OUT] IntPtr的ppidlOut);
[ComImport,
GUID(“--C000-”),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)
接口IEnumIDList
[preserveSig]
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
INT下一页(UINT凯尔特人,IntPtr的rgelt,出UINT pceltFetched);
[preserveSig]
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
INT跳过([IN] UINT凯尔特人);
[preserveSig]
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
INT复位();
[preserveSig]
[MethodImpl(MethodImplOptions.InternalCall,方法codeTYPE =方法codeType.Runtime)
INT克隆([的MarshalAs(UnmanagedType.Interface)出IEnumIDList ppenum);
静态类NativeMethods
函数[DllImport(“SHELL32.DLL”,入口点=“SHGetDesktopFolder”,字符集= CharSet.Uni code,
SetLastError = TRUE)]
静态外部INT SHGetDesktopFolder _([的MarshalAs(UnmanagedType.Interface)出来的IShellFolder ppshf);
公共静态的IShellFolder SHGetDesktopFolder()
结果的IShellF
Marshal.ThrowExceptionForHR(SHGetDesktopFolder_(出结果));
函数[DllImport(“SHELL32.DLL”,入口点=“SHOpenFolderAndSelectItems”)]
静态外部INT SHOpenFolderAndSelectItems_(
[IN]的IntPtr pidlFolder,UINT CIDL,[中,可选的MarshalAs(UnmanagedType.LPArray)] IntPtr的[] apidl,
INT dwFlags中);
公共静态无效SHOpenFolderAndSelectItems(IntPtr的pidlFolder,IntPtr的[] apidl,诠释的dwFlags)
VAR CIDL =(apidl!= NULL)? (UINT)apidl.Length:0U;
VAR的结果= SHOpenFolderAndSelectItems_(pidlFolder,CIDL,apidl,dwFlags中);
Marshal.ThrowExceptionForHR(结果);
函数[DllImport(“Shell32.dll中”)]
公共静态外部无效ILFree([IN] IntPtr的PIDL);
静态的IntPtr GetShellFolderChildrenRelativePIDL(的IShellFolder parentFolder,字符串显示名)
UINT pdwAttributes = 0;
parentFolder.ParseDisplayName(IntPtr.Zero,空,显示名,出pchEaten,出ppidl,楼盘pdwAttributes);
静态的IntPtr PathToAbsolutePIDL(字符串路径)
变种desktopFolder = NativeMethods.SHGetDesktopFolder();
返回GetShellFolderChildrenRelativePIDL(desktopFolder,路径);
静态的Guid = IID_IShellFolder typeof运算(的IShellFolder).GUID;
静态的IShellFolder PIDLToShellFolder(的IShellFolder父,IntPtr的PIDL)
的IShellFolder文件夹;
VAR的结果= parent.BindToObject(PIDL,空,裁判IID_IShellFolder,出文件夹);
Marshal.ThrowExceptionForHR((int)的结果);
返回文件夹;
静态的IShellFolder PIDLToShellFolder(IntPtr的PIDL)
返回PIDLToShellFolder(NativeMethods.SHGetDesktopFolder(),PIDL);
静态无效SHOpenFolderAndSelectItems(IntPtr的pidlFolder,IntPtr的[] apidl,布尔编辑)
NativeMethods.SHOpenFolderAndSelectItems(pidlFolder,apidl,编辑1:0);
公共静态无效FileOrFolder(路径字符串,布尔编辑= FALSE)
如果(路径== NULL)抛出新的ArgumentNullException(“路径”);
VAR PIDL = PathToAbsolutePIDL(路径);
SHOpenFolderAndSelectItems(PIDL,空,编辑);
NativeMethods.ILFree(PIDL);
静态的IEnumerable< FileSystemInfo> PathToFileSystemInfo(IEnumerable的<串GT;路径)
的foreach(在路径VAR路径)
VAR fixedPath =路径;
如果(fixedPath.EndsWith(Path.DirectorySeparatorChar.ToString())
|| fixedPath.EndsWith(Path.AltDirectorySeparatorChar.ToString()))
fixedPath = fixedPath.Remove(fixedPath.Length
如果(Directory.Exists(fixedPath))
产量返回新DirectoryInfo的(fixedPath);
否则,如果(File.Exists(fixedPath))
产量返回新的FileInfo(fixedPath);
抛出新的FileNotFoundException异常
(的String.Format(“指定的文件或文件夹不存在:{0}”,fixedPath)
fixedPath);
公共静态无效FilesOrFolders(字符串parentDirectory,ICollection的<串GT;文件名)
如果(文件名== NULL)抛出新的ArgumentNullException(“文件名”);
如果(filenames.Count == 0)返回;
VAR parentPidl = PathToAbsolutePIDL(parentDirectory);
VAR父= PIDLToShellFolder(parentPidl);
VAR filesPidl =文件名
。选择(文件名=> GetShellFolderChildrenRelativePIDL(父母,文件名))
.ToArray();
SHOpenFolderAndSelectItems(parentPidl,filesPidl,FALSE);
的foreach(在filesPidl VAR PIDL)
NativeMethods.ILFree(PIDL);
NativeMethods.ILFree(parentPidl);
公共静态无效FilesOrFolders(PARAMS字符串[]路径)
FilesOrFolders((IEnumerable的<串GT;)路径);
公共静态无效FilesOrFolders(IEnumerable的<串GT;路径)
如果(路径== NULL)抛出新的ArgumentNullException(“路径”);
FilesOrFolders(PathToFileSystemInfo(路径));
公共静态无效FilesOrFolders(IEnumerable的< FileSystemInfo>路径)
如果(路径== NULL)抛出新的ArgumentNullException(“路径”);
变种pathsArray = paths.ToArray();
如果(pathsArray.Count()== 0)回报;
变种explorerWindows = pathsArray.GroupBy(p值=> Path.GetDirectoryName(p.FullName));
的foreach(在explorerWindows VAR explorerWindowPaths)
VAR parentDirectory = Path.GetDirectoryName(explorerWindowPaths.First()全名);
FilesOrFolders(parentDirectory,explorerWindowPaths.Select(FSI = GT; fsi.Name).ToList());
静态无效的主要()
VAR测试= 3;
开关(测试)
VAR mydocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
ShowSelectedInExplorer.FileOrFolder(Path.Combine(mydocs“的Visual Studio 2010”),编辑:真正的);
ShowSelectedInExplorer.FileOrFolder(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
ShowSelectedInExplorer.FilesOrFolders(@“C:\\ WINDOWS \\”,新的[] {“Microsoft.NET”,“System32下”,“设置”});
ShowSelectedInExplorer.FilesOrFolders(@“C:\\ WINDOWS \\ Microsoft.NET \\”,@“C:\\ Windows \\ System32下”,@“C:\\ WINDOWS \\ SETUP”,@“C:\\ Program Files文件”);
本文地址: &
扫一扫关注IT屋
微信公众号搜索 “ IT屋 ” ,选择关注
与百万开发者在一起
(window.slotbydup = window.slotbydup || []).push({
id: '5828425',
container: s,
size: '300,250',
display: 'inlay-fix'

我要回帖

更多关于 6.0 internal storage 的文章

 

随机推荐