public override void HandleRequest(string jsonString, AjaxBase ajax)
        {
            CheckOtherComponentRequest request = Utility.ParseJson<CheckOtherComponentRequest>(jsonString);

            CheckOtherComponentResponse response = new CheckOtherComponentResponse();
            response.pass = false;

            try
            {
                switch (request.component)
                {
                    case 0:
                        SevenZipBase.SetLibraryPath(request.path);
                        SevenZipCompressor c = new SevenZipCompressor();
                        using (System.IO.MemoryStream m1 = new MemoryStream())
                        {
                            using (System.IO.MemoryStream m2 = new MemoryStream())
                            {
                                byte[] b = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                                m1.Write(b, 0, b.Length);
                                c.CompressStream(m1, m2);
                            }
                        }

                        response.pass = true;
                        break;
                    default:
                        break;
                }
            }
            catch (Exception)
            {
            }

            ajax.ReturnJson(response);
        }
示例#2
0
 private void OtherComponentCheckSuccess(CheckOtherComponentResponse response)
 {
     if (response.pass)
     {
         switch (checkingComponent)
         {
             case 0:
                 SevenZipSettingChecking = false;
                 SevenZipSettingOkay = true;
                 break;
             default:
                 return;
         }
     }
     else
     {
         OtherComponentCheckFailed();
     }
 }