当前位置: 首页>>代码示例>>C#>>正文


C# Shell.NameSpace方法代码示例

本文整理汇总了C#中Shell.NameSpace方法的典型用法代码示例。如果您正苦于以下问题:C# Shell.NameSpace方法的具体用法?C# Shell.NameSpace怎么用?C# Shell.NameSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shell的用法示例。


在下文中一共展示了Shell.NameSpace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: s

        public void s()
        {
            var shell = default(Shell);
            var desktop = default(Folder);

            try
            {
                shell = new Shell();
                desktop = shell.NameSpace(ShellSpecialFolderConstants.ssfDESKTOP);
            }
            finally
            {
                if (desktop != null) { Marshal.ReleaseComObject(desktop); }
                if (shell != null) { Marshal.ReleaseComObject(shell); }
            }
        }
开发者ID:kkkkkkaaaaaa,项目名称:kkkkkkaaaaaa,代码行数:16,代码来源:ShellFacts.cs

示例2: GetFileProps

 Dictionary<int, KeyValuePair<string, string>> GetFileProps(string filename)
 {
     Shell shl = new Shell();
     Folder fldr = shl.NameSpace(Path.GetDirectoryName(filename));
     FolderItem itm = fldr.ParseName(Path.GetFileName(filename));
     Dictionary<int, KeyValuePair<string, string>> fileProps = new Dictionary<int, KeyValuePair<string, string>>();
     for (int i = 0; i < 100; i++)
     {
         string propValue = fldr.GetDetailsOf(itm, i);
         if (propValue != "")
         {
             fileProps.Add(i, new KeyValuePair<string, string>(fldr.GetDetailsOf(null, i), propValue));
         }
     }
     return fileProps;
 }
开发者ID:ericpony,项目名称:comic-gallery,代码行数:16,代码来源:GetVideoInfo.cs

示例3: Restoration

        public Restoration(string dateTime, int dateTimeNegative)
        {
            var shell = new Shell();
            list = new List<FolderItem2>();

            Folder recypleBin = shell.NameSpace(10);

            foreach (FolderItem2 f in from FolderItem2 f in recypleBin.Items()
                                      where f.ModifyDate.ToString(CultureInfo.CurrentCulture).Contains(dateTime.Substring(0, dateTimeNegative))
                                      where f.Type == "Текстовый документ" || f.Type == "Папка с файлами"
                                      select f)
            {
                list.Add(f);
                foreach (var folderItemVerb in
                    f.Verbs().Cast<FolderItemVerb>().Where(folderItemVerb => folderItemVerb.Name.ToUpper().Contains("estore".ToUpper()) || folderItemVerb.Name.ToUpper().Contains("тановить".ToUpper())))
                {
                    folderItemVerb.DoIt();
                    Console.WriteLine(f.Name + " - \t Восстановлен");
                }
            }
            Marshal.FinalReleaseComObject(shell);
        }
开发者ID:Bulat15,项目名称:repository2,代码行数:22,代码来源:Restoration.cs

示例4: GetShortcutTargetFile

        public static bool GetShortcutTargetFile(string shortcutFilename, out String TargetPath, out String TargetDescr)
        {
            bool Result = false;

            TargetPath = string.Empty;
            TargetDescr = string.Empty;

            string pathOnly = System.IO.Path.GetDirectoryName(shortcutFilename);
            string filenameOnly = System.IO.Path.GetFileName(shortcutFilename);

            Shell shell = new Shell();
            Folder folder = shell.NameSpace(pathOnly);
            FolderItem folderItem = folder.ParseName(filenameOnly);

            Result = (folderItem != null);
            if (Result)
            {
                Shell32.ShellLinkObject link = (Shell32.ShellLinkObject)folderItem.GetLink;
                TargetPath  = link.Path;
                //TargetDescr = link.Description;

                String FileName = System.IO.Path.GetFileName(link.Path);
                TargetDescr = FileName;
            } // if (Result)

            return Result;
        }
开发者ID:umlcat,项目名称:ukt4dotnet,代码行数:27,代码来源:FolderExplorerDialog.cs

示例5: GetMediaInfo

        public static void GetMediaInfo(string DataFoldername, string DataFilename, out int bitrate, out string length)
        {
            int bitrateIndex = 28;
            int lengthIndex = 27;

            bitrate = 128;
            length = "00:04:00";

            Shell shell = new Shell();
            Folder objFolder;

            objFolder = shell.NameSpace(DataFoldername);

            /*
            for (int i = 0; i < short.MaxValue; i++)
            {
                string header = objFolder.GetDetailsOf(null, i);
                if (String.IsNullOrEmpty(header))
                    break;
                if (header.Contains("bitrate"))
                    bitrateIndex = i;
                if (header.Contains("length"))
                    bitrateIndex = i;
            }
            */

            FolderItem item = objFolder.ParseName(DataFilename);
            length = objFolder.GetDetailsOf(item, lengthIndex);
            string temp = objFolder.GetDetailsOf(item, bitrateIndex);
            int tempbitrate = 0;
            for (int i = 0; i < temp.Length; i++)
            {
                if (char.IsDigit(temp[i]))
                    tempbitrate = tempbitrate * 10 + temp[i] - 0x30;
            }
            if (tempbitrate != 0)
                bitrate = tempbitrate;

            return;
        }
开发者ID:PhuNH,项目名称:qtmusic2011,代码行数:40,代码来源:song.cs

示例6: GetFileDetails

 public string GetFileDetails(string fileFolder, string filePath, infoFile infotype)
 {
     try
     {
         Shell fileshell = new Shell();
         Folder fileshellfolder = fileshell.NameSpace(fileFolder);
         return fileshellfolder.GetDetailsOf(fileshellfolder.ParseName(filePath), (int)infotype);
     }
     catch
     {
         return string.Empty;
     }
 }
开发者ID:hopesend,项目名称:DateYourPhotos,代码行数:13,代码来源:ShellFileInfo.cs

示例7: printMetaData

        private static void printMetaData(string musikFolder)
        {
            List<string> arrHeaders = new List<string>();

            EntryText("Writing MetaData");

            Shell32.Shell _shell = new Shell();
            Shell32.Folder _objFolder = _shell.NameSpace(musikFolder);

            for (int i = 0; i < short.MaxValue; i++)
            {
                string header = _objFolder.GetDetailsOf(null, i);
                if (String.IsNullOrEmpty(header))
                    break;
                arrHeaders.Add(header);
            }

            foreach (var items in _objFolder.Items())
            {
                for (int i = 0; i < arrHeaders.Count; i++)
                {
                    Console.WriteLine("{0}\t{1}: {2}", i, arrHeaders[i], _objFolder.GetDetailsOf(items, i));
                }
                break;
            }
        }
开发者ID:GufCab,项目名称:Semester-Projekt---PC-Program,代码行数:26,代码来源:Program.cs


注:本文中的Shell.NameSpace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。