• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Dokan.DokanFileInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Dokan.DokanFileInfo的典型用法代码示例。如果您正苦于以下问题:C# DokanFileInfo类的具体用法?C# DokanFileInfo怎么用?C# DokanFileInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DokanFileInfo类属于Dokan命名空间,在下文中一共展示了DokanFileInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateFile

        public int CreateFile(string filename, FileAccess access, FileShare share, FileMode mode, FileOptions options, DokanFileInfo info)
        {
            Trace.WriteLine(string.Format("CreateFile FILENAME({0}) ACCESS({1}) SHARE({2}) MODE({3})", filename, access, share, mode));

            if (mode == FileMode.Create || mode == FileMode.OpenOrCreate || mode == FileMode.CreateNew)
            {
                // we want to write a file
                var fileRef = Extensions.GetFileReference(root, filename.ToFileString());
                fileRef.Create(0);
                return 0;
            }

            if (share == FileShare.Delete)
            {
                return DeleteFile(filename, info);
            }

            if (GetFileInformation(filename, new FileInformation(), new DokanFileInfo(0)) == 0)
            {
                return 0;
            }
            else
            {
                return -DokanNet.ERROR_FILE_NOT_FOUND;
            }
        }
开发者ID:richorama,项目名称:AzureFileDrive,代码行数:26,代码来源:AzureOperations.cs


示例2: OpenDirectory

 public int OpenDirectory(string filename, DokanFileInfo info)
 {
     Console.WriteLine("openDir: " + filename);
     info.Context = count++;
     info.IsDirectory = true;
     return 0;
 }
开发者ID:anirnet,项目名称:raf-manager,代码行数:7,代码来源:Program.cs


示例3: CreateDirectory

 public int CreateDirectory(string filename, DokanFileInfo info)
 {
     Trace.WriteLine(string.Format("CreateDirectory {0}", filename));
     var dirRef = Extensions.GetDirectoryReference(root, filename.ToFileString());
     dirRef.CreateIfNotExists();
     return 0;
 }
开发者ID:richorama,项目名称:AzureFileDrive,代码行数:7,代码来源:AzureOperations.cs


示例4: FindFiles

 public int FindFiles(String filename, ArrayList files, DokanFileInfo info)
 {
     string path = GetPath(filename);
     if (Directory.Exists(path))
     {
         DirectoryInfo d = new DirectoryInfo(path);
         FileSystemInfo[] entries = d.GetFileSystemInfos();
         foreach (FileSystemInfo f in entries)
         {
             FileInformation fi = new FileInformation();
             fi.Attributes = f.Attributes;
             fi.CreationTime = f.CreationTime;
             fi.LastAccessTime = f.LastAccessTime;
             fi.LastWriteTime = f.LastWriteTime;
             fi.Length = (f is DirectoryInfo) ? 0 : ((FileInfo)f).Length;
             fi.FileName = f.Name;
             files.Add(fi);
         }
         return 0;
     }
     else
     {
         return -1;
     }
 }
开发者ID:jvd001,项目名称:DokanNet,代码行数:25,代码来源:Program.cs


示例5: CreateFile

        //Windows System Error Codes @ http://www.hiteksoftware.com/knowledge/articles/049.htm
        public int CreateFile(string filename, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileMode mode, System.IO.FileOptions options, DokanFileInfo info)
        {
            Console.WriteLine("crFile: " + filename);

            info.Context = count++;

            if (filename.Trim() == "\\")
            {
                info.IsDirectory = true;
                return 0;
            }
            else
            {
                RAFInMemoryFileSystemObject fso = rafManager.ResolveRAFPathTOFSO(filename);
                Console.WriteLine("-> FSO NULL? " + (fso == null));
                if (fso == null) return -DokanNet.ERROR_ACCESS_DENIED;
                else
                {
                    if (fso.GetFSOType() == RAFFSOType.DIRECTORY)
                        info.IsDirectory = true;
                    return 0;
                }
            }
            //return -82;
        }
开发者ID:anirnet,项目名称:raf-manager,代码行数:26,代码来源:Program.cs


示例6: CreateFile

        public int CreateFile(string filename, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileMode mode, System.IO.FileOptions options, DokanFileInfo info)
        {
            try
            {
                Console.WriteLine("Create File "+filename+" access "+access+" share "+share+" mode "+mode+ " options "+options+" info "+info);
                Root root = mergedDirs.getRootWithBestSpace(0);

                if ((mode == FileMode.Create || mode == FileMode.CreateNew || mode == FileMode.OpenOrCreate )&& !root.ContainsDirectory(Path.GetDirectoryName(filename)))
                {

                    root.mkDirs(Path.GetDirectoryName(filename));
                }

                if (Directory.Exists(root.getRealPath(filename)))
                {
                    info.IsDirectory = true;
                }
                else if(access != FileAccess.Read)
                {
                    mergedDirs.createFile(filename,mode);
                }

                return 0;
            }
            catch (Exception e)
            {
                Console.WriteLine("Caught an exception: " + e + ": " + e.Message);
                return -1;
            }
        }
开发者ID:harryrose,项目名称:MergeFS,代码行数:30,代码来源:MergedFileSystem.cs


示例7: OpenDirectory

 public int OpenDirectory(String filename, DokanFileInfo info)
 {
     info.Context = count_++;
     if (Directory.Exists(GetPath(filename)))
         return 0;
     else
         return -DokanNet.ERROR_PATH_NOT_FOUND;
 }
开发者ID:stux2000,项目名称:dokan,代码行数:8,代码来源:Program.cs


示例8: GetDiskFreeSpace

 public int GetDiskFreeSpace(ref ulong freeBytesAvailable, ref ulong totalBytes,
                             ref ulong totalFreeBytes, DokanFileInfo info)
 {
     freeBytesAvailable = 512*1024*1024;
     totalBytes = 1024*1024*1024;
     totalFreeBytes = 512*1024*1024;
     return 0;
 }
开发者ID:iBat,项目名称:WotStatMiniServer,代码行数:8,代码来源:Program.cs


示例9: CreateDirectory

 public int CreateDirectory(string filename, DokanFileInfo info)
 {
     int result = _fileSystem.CreateDirectory(filename, info);
     if (this._logging)
     {
         Console.WriteLine("CreateDirectory: " + filename);
         Console.WriteLine("Result: " + result);
     }
     return result;
 }
开发者ID:daveroberts,项目名称:FUSEManager,代码行数:10,代码来源:LoggingFS.cs


示例10: DeleteFile

 public int DeleteFile(string filename, DokanFileInfo info)
 {
     int result = _fileSystem.DeleteFile(filename, info);
     if (this._logging)
     {
         Console.WriteLine("DeleteFile: " + filename);
         Console.WriteLine("Result: " + result);
     }
     return result;
 }
开发者ID:daveroberts,项目名称:FUSEManager,代码行数:10,代码来源:LoggingFS.cs


示例11: CreateFile

 public int CreateFile(string filename, FileAccess access, FileShare share, FileMode mode, FileOptions options, DokanFileInfo info)
 {
     int result = _fileSystem.CreateFile(filename, access, share, mode, options, info);
     if (this._logging)
     {
         Console.WriteLine("CreateFile: " + filename);
         Console.WriteLine("Result: " + result);
     }
     return result;
 }
开发者ID:daveroberts,项目名称:FUSEManager,代码行数:10,代码来源:LoggingFS.cs


示例12: Cleanup

 public int Cleanup(string filename, DokanFileInfo info)
 {
     int result = _fileSystem.Cleanup(filename, info);
     if (this._logging)
     {
         Console.WriteLine("Cleanup: " + filename);
         Console.WriteLine("Result: " + result);
     }
     return result;
 }
开发者ID:daveroberts,项目名称:FUSEManager,代码行数:10,代码来源:LoggingFS.cs


示例13: CreateFile

 public int CreateFile(
     string filename,
     System.IO.FileAccess access,
     System.IO.FileShare share,
     System.IO.FileMode mode,
     System.IO.FileOptions options,
     DokanFileInfo info)
 {
     return 0;
 }
开发者ID:stux2000,项目名称:dokan,代码行数:10,代码来源:Program.cs


示例14: ConvertFileInfo

 private void ConvertFileInfo(ref DOKAN_FILE_INFO rawInfo, DokanFileInfo info)
 {
     info.IsDirectory = rawInfo.IsDirectory == 1;
     info.ProcessId = rawInfo.ProcessId;
     info.PagingIo = rawInfo.PagingIo == 1;
     info.DeleteOnClose = rawInfo.DeleteOnClose == 1;
     info.SynchronousIo = rawInfo.SynchronousIo == 1;
     info.Nocache = rawInfo.Nocache == 1;
     info.WriteToEndOfFile = rawInfo.WriteToEndOfFile == 1;
 }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:10,代码来源:Proxy.cs


示例15: CreateFile

 public virtual int CreateFile(string filename, 
     FileAccess access, 
     FileShare share, 
     FileMode mode, 
     FileOptions options, 
     DokanFileInfo info)
 {
     try { return -1; }
     catch { return -1; }
 }
开发者ID:meowthsli,项目名称:tagfs,代码行数:10,代码来源:TaggedFileSystem.cs


示例16: CreateDirectory

        public int CreateDirectory(string filename, DokanFileInfo info)
        {
            Console.WriteLine("Create Directory : " + filename);

            var response = MakeComplexRequest(Path + CREATE_DIRECTORY_REQUEST_STRING, filename, info.ProcessId);

            if (response.ContainsKey("message"))
                Console.WriteLine("Create Directory Message : " + response["message"]);

            return int.Parse(response["response_code"]);
        }
开发者ID:martindevans,项目名称:dokan-gae-client,代码行数:11,代码来源:GaeFs.cs


示例17:

 int DokanOperations.GetFileInformation(string filename, FileInformation fileinfo, DokanFileInfo info)
 {
     VFileInfo vinfo;
     int status = data.GetFileInformation (filename, out vinfo);
     fileinfo.Attributes = vinfo.Attributes;
     fileinfo.CreationTime = vinfo.CreationTime;
     fileinfo.LastAccessTime = vinfo.LastAccessTime;
     fileinfo.LastWriteTime = vinfo.LastWriteTime;
     fileinfo.Length = vinfo.Length;
     return status;
 }
开发者ID:TimePath,项目名称:major,代码行数:11,代码来源:DokanConsumer.cs


示例18: CreateFile

        public int CreateFile(string filename, FileAccess access, FileShare share, FileMode mode, FileOptions options, DokanFileInfo info)
        {
            Console.WriteLine("Create File : " + filename);

            var response = MakeComplexRequest(Path + CREATE_FILE_REQUEST_STRING, SecurityElement.Escape(filename), (int)access, (int)share, (int)mode, (int)options, info.ProcessId);

            if (response.ContainsKey("message"))
                Console.WriteLine("Create File Message : " + response["message"]);

            return int.Parse(response["response_code"]);
        }
开发者ID:martindevans,项目名称:dokan-gae-client,代码行数:11,代码来源:GaeFs.cs


示例19: CloseFile

        public int CloseFile(string filename, DokanFileInfo info)
        {
            Console.WriteLine("Close File : " + filename);

            var response = MakeComplexRequest(Path + CLOSE_FILE_REQUEST_STRING, filename, info.ProcessId);

            if (response.ContainsKey("message"))
                Console.WriteLine("Create File Message : " + response["message"]);

            return int.Parse(response["response_code"]);
        }
开发者ID:martindevans,项目名称:dokan-gae-client,代码行数:11,代码来源:GaeFs.cs


示例20: Cleanup

        public int Cleanup(string filename, DokanFileInfo info)
        {
            //Clean
            DirCache = new Dictionary<string, Dictionary<string, int>>();
            DirCache["Categories"] = new Dictionary<string, int>();
            DirCache["Main namespace"] = new Dictionary<string, int>();
            DirCache["Templates"] = new Dictionary<string, int>();
            DirCache["Forms"] = new Dictionary<string, int>();
            DirCache["Properties"] = new Dictionary<string, int>();

            return 0;
        }
开发者ID:vedmaka,项目名称:mediawikifs,代码行数:12,代码来源:MWFS.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DokanNet.DokanFileInfo类代码示例发布时间:2022-05-24
下一篇:
C# Dokan.DOKAN_FILE_INFO类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap