當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。