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


C# FileInfo.GetNameWithoutExtension方法代码示例

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


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

示例1: StartMenuResult

        public StartMenuResult(IResultProvider provider, FileInfo file)
        {
            _file = file;

            ID = Hash.CreateFrom(file.FullName);
            Title = file.GetNameWithoutExtension();
            Description = file.Directory.FullName;
            Provider = provider;
        }
开发者ID:jaywick,项目名称:Vizr,代码行数:9,代码来源:StartMenuResult.cs

示例2: StringSplitByKeyTest

        public void StringSplitByKeyTest()
        {
            String target = "a: bcd e: fg h: i h:";
            Dictionary<String, String> answers = target.SplitByKey("a:|e:|h:", true);

            Assert.True(answers.Count == 3);

            String location = @"C:\WebPage\FortinetIDS\12113.html";
            FileInfo file = new FileInfo(location);
            String answer = file.GetNameWithoutExtension();
        }
开发者ID:JasonSoft,项目名称:JasonSoft,代码行数:11,代码来源:ExtensionTestCase.cs

示例3: FileSearchResult

        public FileSearchResult(IResultProvider provider, FileInfo fileInfo)
        {
            _fileInfo = fileInfo;

            Provider = provider;
            ID = Hash.CreateFrom(_fileInfo.FullName);
            Title = fileInfo.GetNameWithoutExtension();
        }
开发者ID:jaywick,项目名称:Vizr,代码行数:8,代码来源:FileSystemSearchResults.cs

示例4: GetNameFromFilePath

        private string GetNameFromFilePath(string filePath)
        {
            FileInfo keyFile = new FileInfo(filePath);

            return keyFile.GetNameWithoutExtension();
        }
开发者ID:giladbi,项目名称:Observer,代码行数:6,代码来源:Instrument.cs

示例5: ExportTableConfiguration_Click

 private void ExportTableConfiguration_Click(object sender, EventArgs e)
 {
     if (!Pinball.Table.TableConfigurationFilename.IsNullOrWhiteSpace())
     {
         FileInfo FI = new FileInfo(Pinball.Table.TableConfigurationFilename);
         SaveTableConfigDialog.InitialDirectory = FI.Directory.FullName;
         SaveTableConfigDialog.FileName = FI.FullName;
     }
     else if (!Pinball.Table.TableFilename.IsNullOrWhiteSpace())
     {
         FileInfo FI = new FileInfo(Pinball.Table.TableFilename);
         SaveTableConfigDialog.InitialDirectory = FI.Directory.FullName;
         SaveTableConfigDialog.FileName = Path.Combine(FI.Directory.FullName,"{0}.xml".Build(FI.GetNameWithoutExtension()));
     }
     else
     {
         SaveTableConfigDialog.InitialDirectory = Pinball.GlobalConfig.GetGlobalConfigDirectory().FullName;
     }
     if (SaveTableConfigDialog.ShowDialog() == DialogResult.OK)
     {
         Pinball.Table.TableConfigurationFilename = SaveTableConfigDialog.FileName;
         try
         {
             Pinball.Table.SaveConfigXmlFile(SaveTableConfigDialog.FileName);
             UpdateWindowTitle();
             MessageBox.Show("Table configuration saved to\n{0}".Build(SaveTableConfigDialog.FileName), "Table configuration saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         catch (Exception E)
         {
             MessageBox.Show("Could not save table config to\n{0}\n\nThe following error occured:\n{1}".Build(SaveTableConfigDialog.FileName, E.Message), "File save error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
开发者ID:ewingnnut,项目名称:DirectOutput,代码行数:33,代码来源:TableInfo.cs


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