• 学习C#,每天一话


    1、获取路径中的文件名

    System.IO.Path.GetFileName 和 System.IO.Path.GetFileNameWithoutExtension(无扩展名)的方法。

    2、C# 实现遍历注册表的某个项下的所有子项

    比如想得到HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion下的所以的KEY。

    RegistryKey rkey = Registry.LocalMachine;
    RegistryKey subKey = rkey.OpenSubKey(@"SOFTWAREMicrosoftWindowsCurrentVersion" );
    string[] keyNames = subKey.GetSubKeyNames();
    foreach ( string keyName in keyNames )
    {
          Console.WriteLine(keyName);
    }

     

       


    作者:LiaoHaoYu
    出处:http://www.cnblogs.com/igolang/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

     
  • 相关阅读:
    Interrupt、Interrupted、IsInterrupted
    ReentrantLock
    tcp粘包、拆包
    jstat 分析应用垃圾回收状况
    CopyOnWriteArrayList
    storm基础概念
    余弦距离
    websocket
    awk
    sed
  • 原文地址:https://www.cnblogs.com/igolang/p/3410478.html
Copyright © 2020-2023  润新知