Example #1
0
 /// <summary>
 /// 获取超级狗中的数据文件内容
 /// </summary>
 /// <param name="FileId">数据文件ID</param>
 /// <returns></returns>
 public static string GetDogFile(int FileId)
 {
     SuperDog.Dog       dog    = new SuperDog.Dog(SuperDog.DogFeature.Default);
     SuperDog.DogStatus dogSta = dog.Login(DogVendorCode.Code);
     if (dogSta == SuperDog.DogStatus.StatusOk)
     {
         //读取第一个数据文件(即用户名)
         SuperDog.DogFile df = dog.GetFile(FileId);
         if (df.IsLoggedIn())
         {
             int size = 0;
             dogSta = df.FileSize(ref size);
             if (dogSta == SuperDog.DogStatus.StatusOk)
             {
                 byte[] bytes = new byte[size];
                 dogSta = df.Read(bytes, 0, bytes.Length);
                 if (SuperDog.DogStatus.StatusOk == dogSta)
                 {
                     string aaa = Encoding.ASCII.GetString(bytes);
                     if (dog.IsLoggedIn())
                     {
                         dog.Logout();
                     }
                     return(aaa);
                 }
             }
         }
     }
     if (dog.IsLoggedIn())
     {
         dog.Logout();
     }
     return("");
 }
Example #2
0
File: Comm.cs Project: wcgcw/Finder
 /// <summary>
 /// 获取超级狗中的数据文件内容
 /// </summary>
 /// <param name="FileId">数据文件ID</param>
 /// <returns></returns>
 public static string GetDogFile(int FileId)
 {
     SuperDog.Dog dog = new SuperDog.Dog(SuperDog.DogFeature.Default);
     SuperDog.DogStatus dogSta = dog.Login(DogVendorCode.Code);
     if (dogSta == SuperDog.DogStatus.StatusOk)
     {
         //读取第一个数据文件(即用户名)
         SuperDog.DogFile df = dog.GetFile(FileId);
         if (df.IsLoggedIn())
         {
             int size = 0;
             dogSta = df.FileSize(ref size);
             if (dogSta == SuperDog.DogStatus.StatusOk)
             {
                 byte[] bytes = new byte[size];
                 dogSta = df.Read(bytes, 0, bytes.Length);
                 if (SuperDog.DogStatus.StatusOk == dogSta)
                 {
                     string aaa = Encoding.ASCII.GetString(bytes);
                     if (dog.IsLoggedIn()) { dog.Logout(); }
                     return aaa;
                 }
             }
         }
     }
     if (dog.IsLoggedIn()) { dog.Logout(); }
     return "";
 }