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


C# DirectoryInfo.ToLower方法代码示例

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


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

示例1: Awake

 public void Awake()
 {
     Profiler.DMPReferenceTime.Start();
     GameObject.DontDestroyOnLoad(this);
     assemblyPath = new DirectoryInfo(Assembly.GetExecutingAssembly().Location).FullName;
     string kspPath = new DirectoryInfo(KSPUtil.ApplicationRootPath).FullName;
     //I find my abuse of Path.Combine distrubing.
     assemblyShouldBeInstalledAt = Path.Combine(Path.Combine(Path.Combine(Path.Combine(kspPath, "GameData"), "DarkMultiPlayer"), "Plugins"), "DarkMultiPlayer.dll");
     UnityEngine.Debug.Log("KSP installed at " + kspPath);
     UnityEngine.Debug.Log("DMP installed at " + assemblyPath);
     incorrectlyInstalled = (assemblyPath.ToLower() != assemblyShouldBeInstalledAt.ToLower());
     if (incorrectlyInstalled)
     {
         UnityEngine.Debug.LogError("DMP is installed at '" + assemblyPath + "', It should be installed at '" + assemblyShouldBeInstalledAt + "'");
         return;
     }
     if (Settings.fetch.disclaimerAccepted != 1)
     {
         modDisabled = true;
         DisclaimerWindow.Enable();
     }
     SetupDirectoriesIfNeeded();
     //Register events needed to bootstrap the workers.
     lock (eventLock)
     {
         resetEvent.Add(LockSystem.Reset);
         resetEvent.Add(AdminSystem.Reset);
         resetEvent.Add(AsteroidWorker.Reset);
         resetEvent.Add(ChatWorker.Reset);
         resetEvent.Add(CraftLibraryWorker.Reset);
         resetEvent.Add(DebugWindow.Reset);
         resetEvent.Add(DynamicTickWorker.Reset);
         resetEvent.Add(FlagSyncer.Reset);
         resetEvent.Add(PlayerColorWorker.Reset);
         resetEvent.Add(PlayerStatusWindow.Reset);
         resetEvent.Add(PlayerStatusWorker.Reset);
         resetEvent.Add(QuickSaveLoader.Reset);
         resetEvent.Add(ScenarioWorker.Reset);
         resetEvent.Add(ScreenshotWorker.Reset);
         resetEvent.Add(TimeSyncer.Reset);
         resetEvent.Add(VesselWorker.Reset);
         resetEvent.Add(WarpWorker.Reset);
         GameEvents.onHideUI.Add(() =>
         {
             showGUI = false;
         });
         GameEvents.onShowUI.Add(() =>
         {
             showGUI = true;
         });
     }
     FireResetEvent();
     HandleCommandLineArgs();
     DarkLog.Debug("DarkMultiPlayer " + Common.PROGRAM_VERSION + ", protocol " + Common.PROTOCOL_VERSION + " Initialized!");
 }
开发者ID:nux17,项目名称:DarkMultiPlayer,代码行数:55,代码来源:Main.cs

示例2: ConsistencyCheckCategoryLocalToSlide

        private bool ConsistencyCheckCategoryLocalToSlide()
        {
            var categoriesOnDisk = Directory.EnumerateDirectories(Path).ToList();
            var categoryLost = false;

            foreach (var categoryPath in categoriesOnDisk)
            {
                var categoryName = new DirectoryInfo(categoryPath).Name;

                if (Slides.All(category => category.Name.ToLower() != categoryName.ToLower()))
                {
                    categoryLost = true;
                    break;
                }
            }

            return categoryLost;
        }
开发者ID:suheti,项目名称:powerpointlabs,代码行数:18,代码来源:PowerPointShapeGalleryPresentation.cs

示例3: Main


//.........这里部分代码省略.........
                var skipList = GetSkipList(settings);

                //capture /web
                var slashWebExist = settings.ContainsKey("web");
                if (slashWebExist)
                {
                    //capture /web /r
                    var slashRExist = settings.ContainsKey("r");
                    if (slashRExist)
                    {
                        //capture /web /r /u
                        var slashUExist = settings.ContainsKey("u");
                        if (slashUExist)
                        {
                            var userName = settings.SingleOrDefault(s => s.Key == "u").Value;

                            var sinkRegistrar = new WebSinkRegistrar();
                            var registration = sinkRegistrar.Register(userName);

                            if (null != registration)
                            {
                                string response =
                                      $"{Environment.NewLine}   Api Key: {registration.ApiKey}"
                                    + $"{Environment.NewLine}   Workspace: {registration.Workspace}"
                                    + $"{Environment.NewLine}   Workspace Uri: {registration.WorkspaceUri}"
                                    + $"{Environment.NewLine}   Account Uri: {registration.AccountUri}";

                                ConsoleEx.Ok($"Done! Please keep your API key secret.{response}");
                            }
                        }
                    }

                    //capture /web /apk /ws /wsn
                    var slashApkExist = settings.ContainsKey("apk");
                    if (slashApkExist)
                    {
                        var apiKey = settings.SingleOrDefault(s => s.Key == "apk").Value;

                        //validate working folder /ws is required parameter
                        string slashWs = settings.SingleOrDefault(s => s.Key == "ws").Value;
                        if (null == slashWs)
                        {
                            throw new ArgumentException("Missing parameter", "ws");
                        }

                        //validate working folder /wsn is required parameter
                        string slashWsn = settings.SingleOrDefault(s => s.Key == "wsn").Value;
                        if (null == slashWsn)
                        {
                            throw new ArgumentException("Missing parameter", "wsn");
                        }

                        //run all trackers, at this point we have all the dependencies
                        var trackerResult = TrackDependencies(slashWs, skipList);

                        //create the workspace details
                        var workspace = new Workspace
                        {
                            Name = slashWsn,
                            Solutions = trackerResult.Solutions,
                            Logs = trackerResult.Logs,
                            ApiKey = apiKey
                        };

                        var webSink = new WebSink();
                        webSink.Flush(workspace);
                    }
                }
                else
                {
                    //capture /ws
                    string slashWs = settings.SingleOrDefault(s => s.Key == "ws").Value;
                    if (null == slashWs)
                    {
                        throw new ArgumentException("Missing parameter", "ws");
                    }

                    //fall back to default csv as default sink 
                    //run all trackers, at this point we have all the dependencies
                    var trackerResult = TrackDependencies(slashWs, skipList);

                    //create the workspace details
                    string worspaceName = new DirectoryInfo(slashWs.TrimEnd(Path.DirectorySeparatorChar)).Name;
                    var workspace = new Workspace
                    {
                        Name = worspaceName.ToLower(),
                        Solutions = trackerResult.Solutions,
                        Logs = trackerResult.Logs
                    };

                    //run default sink
                    SinkDependencies("csv", workspace);
                }

            }
            catch (Exception ex)
            {
                ConsoleEx.Error("Arnis.NET breaks ;(. \n" + ex.Message);
            }
        }
开发者ID:rdagumampan,项目名称:arnis,代码行数:101,代码来源:Program.cs

示例4: CreateReconciliationFile

        public void CreateReconciliationFile(string sourcePath)
        {
            try
            {
                using (var container = new TransactionModelContainer())
                {
                    var fileName = GetFileName(sourcePath);
                    var fileinfo = new FileInfo(fileName);
                    var contents = ReadFile(sourcePath);

                    if (!IsValidFile(fileinfo))
                    {
                        var newFileName = MoveFileToFolder(container, errPath, sourcePath, fileinfo);
                        container.ReconciliationFiles.AddObject(new ReconciliationFile
                        {
                            FileName = fileinfo.Name,
                            Contents = contents,
                            CreateDate = DateTime.Now,
                            CreateBy = "System",
                            BackupPath = errPath + newFileName,
                            IsValid = false,
                            Source = null,
                            IsRead = false,
                            FileType = FileType.E.ToString(),
                        });
                    }
                    else
                    {
                        var parentFolder = new DirectoryInfo(successPath).Parent.Name;
                        var newFileName = MoveFileToFolder(container, successPath, sourcePath, fileinfo);
                        container.ReconciliationFiles.AddObject(new ReconciliationFile
                        {
                            FileName = fileinfo.Name,
                            Contents = contents,
                            CreateDate = DateTime.Now,
                            CreateBy = "System",
                            BackupPath = newFileName, //successPath + newFileName,
                            IsValid = true,
                            Source = null,
                            IsRead = false,
                            FileType = (parentFolder.ToLower().Contains("credit"))
                                            ? FileType.C.ToString()
                                            : FileType.P.ToString(),
                        });
                    }
                    container.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("System", ex, SystemError.ServiceReader);
            }
        }
开发者ID:anupong-s,项目名称:Transaction,代码行数:53,代码来源:Reader.cs

示例5: CheckLogin

        public override bool CheckLogin(string username, string password, VirtualFtpSession session)
        {
            if (username.ToLower().Equals(server.RootFolder.Name.ToLower()))
            {
                return Common.Solution.CreateFromContext("").RootPassword.Equals(password);
            }

            String[] arr = username.Split('_');
            if (arr.Length == 2)
            {
                String solutionName = arr[0];

                if (arr[1].ToLower().Equals("admin"))
                {

                    foreach (String dir in System.IO.Directory.EnumerateDirectories(rootPath))
                    {
                        String name = new System.IO.DirectoryInfo(dir).Name;
                        if (solutionName.ToLower().Equals(name.ToLower()))
                        {
                            return Common.Solution.CreateFromContext(solutionName).SolutionPassword.Equals(password);
                        }
                    }
                    return false;
                }

                Guid userId;
                if (System.Guid.TryParse(arr[1], out userId))
                {
                    return Common.Logon.UserExists(solutionName, userId, password);
                }
            }

            return false;
        }
开发者ID:Fedorm,项目名称:core-master,代码行数:35,代码来源:FtpServer.cs


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