VirtualFileSystem.VFS.AssertNameValid C# (CSharp) Method

AssertNameValid() public static method

文件名无效时抛出异常
public static AssertNameValid ( String name ) : void
name String
return void
        public static void AssertNameValid(String name)
        {
            if (!IsNameValid(name))
            {
                throw new Exception("无效文件名");
            }
        }

Usage Example

示例#1
0
            /// <summary>
            /// 创建一个文件夹
            /// </summary>
            /// <param name="name"></param>
            public void CreateDirectory(String name)
            {
                VFS.AssertNameValid(name);

                INode inode = vfs.AllocateINode(1, 2333);

                if (!dir.Add(name, new INodeDirectory(vfs, inode)))
                {
                    throw new Exception("创建文件夹失败");
                }
            }
All Usage Examples Of VirtualFileSystem.VFS::AssertNameValid