コード例 #1
0
ファイル: Directory.cs プロジェクト: Tsalex71/mono-1
        public static void SetCurrentDirectory(string path)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            if (path.Trim().Length == 0)
            {
                throw new ArgumentException("path string must not be an empty string or whitespace string");
            }

            MonoIOError error;

            if (!Exists(path))
            {
                throw new DirectoryNotFoundException("Directory \"" +
                                                     path + "\" not found.");
            }

            MonoIO.SetCurrentDirectory(path, out error);
            if (error != MonoIOError.ERROR_SUCCESS)
            {
                throw MonoIO.GetException(path, error);
            }
        }