StartTask() 공개 메소드

public StartTask ( IEnumerator coroutine, bool autoStart = true, UnityAction finishedHandle = null ) : Task
coroutine IEnumerator
autoStart bool
finishedHandle UnityAction
리턴 Task
예제 #1
0
        public static int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId)
        {
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            TaskManager.StartTask("LYNC", "SET_LYNC_LYNCUSERPLAN", itemId);

            try
            {
                DataProvider.SetOrganizationDefaultLyncUserPlan(itemId, lyncUserPlanId);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }

            return(1);
        }
예제 #2
0
        private async Task StartFeeds(DiscordMessage message, List <string> feeds)
        {
            var msg     = string.Empty;
            var started = new List <string>();
            var failed  = new List <string>();

            try
            {
                foreach (var cityName in feeds)
                {
                    if (TaskManager.StartTask("RM " + cityName))
                    {
                        started.Add(cityName);
                    }
                    else
                    {
                        failed.Add(cityName);
                    }
                }

                await message.RespondAsync
                (
                    (started.Count > 0
                        ? $"{message.Author.Mention} started feed(s) **{string.Join("**, **", started)}**."
                        : string.Empty) +
                    (failed.Count > 0
                        ? $"\r\n{message.Author.Mention} failed to start feed(s) **{string.Join("**, **", failed)}**."
                        : string.Empty)
                );
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
            }
        }
예제 #3
0
        public static SfBFederationDomain[] GetFederationDomains(int itemId)
        {
            // place log record
            TaskManager.StartTask("SFB", "GET_SFB_FEDERATIONDOMAINS", itemId);

            SfBFederationDomain[] sfbFederationDomains = null;

            try
            {
                Organization org = (Organization)PackageController.GetPackageItem(itemId);

                int       sfbServiceId = GetSfBServiceID(org.PackageId);
                SfBServer sfb          = GetSfBServer(sfbServiceId, org.ServiceId);

                sfbFederationDomains = sfb.GetFederationDomains(org.OrganizationId);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }

            return(sfbFederationDomains);
        }
예제 #4
0
        public static int DeleteOrganization(int itemId)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // place log record
            TaskManager.StartTask("LYNC", "DELETE_ORG", itemId);

            try
            {
                // delete organization in Exchange
                //System.Threading.Thread.Sleep(5000);
                Organization org = (Organization)PackageController.GetPackageItem(itemId);

                int        lyncServiceId = GetLyncServiceID(org.PackageId);
                LyncServer lync          = GetLyncServer(lyncServiceId, org.ServiceId);

                bool successful = lync.DeleteOrganization(org.OrganizationId, org.DefaultDomain);

                return(successful ? 0 : BusinessErrorCodes.ERROR_LYNC_DELETE_SOME_PROBLEMS);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
        /// <summary>
        /// Gets list of supported languages by this installation of SharePoint.
        /// </summary>
        /// <returns>List of supported languages</returns>
        public static int[] GetSupportedLanguages(int packageId)
        {
            if (IsDemoMode)
            {
                return(new int[] { 1033 });
            }

            // Log operation.
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "GET_LANGUAGES");

            int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointEnterpriseServer);

            if (serviceId == 0)
            {
                return(new int[] { });
            }

            try
            {
                // Create site collection on server.
                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId);
                return(hostedSharePointServer.Enterprise_GetSupportedLanguages());
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #6
0
        public static LyncFederationDomain[] GetFederationDomains(int itemId)
        {
            // place log record
            TaskManager.StartTask("LYNC", "GET_LYNC_FEDERATIONDOMAINS", itemId);

            LyncFederationDomain[] lyncFederationDomains = null;

            try
            {
                Organization org = (Organization)PackageController.GetPackageItem(itemId);

                int        lyncServiceId = GetLyncServiceID(org.PackageId);
                LyncServer lync          = GetLyncServer(lyncServiceId, org.ServiceId);

                lyncFederationDomains = lync.GetFederationDomains(org.OrganizationId);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }

            return(lyncFederationDomains);
        }
예제 #7
0
        public static int DeleteLyncUserPlan(int itemID, int lyncUserPlanId)
        {
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            TaskManager.StartTask("LYNC", "DELETE_LYNC_LYNCPLAN", itemID);

            try
            {
                DataProvider.DeleteLyncUserPlan(lyncUserPlanId);

                return(0);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #8
0
        private XmlDocument GetServiceResponse()
        {
            WebClient ecb = new WebClient();

            try
            {
                TaskManager.StartTask("CURRENCY_HELPER", "LOAD_CURRENCIES_RATES");

                XmlDocument xmlDoc = new XmlDocument();

                xmlDoc.LoadXml(
                    ecb.DownloadString(
                        ServiceUrl
                        )
                    );

                return(xmlDoc);
            }
            catch (Exception ex)
            {
                TaskManager.WriteError(ex, "Failed to get response from www.ecb.int");
            }
            finally
            {
                TaskManager.CompleteTask();
            }

            return(null);
        }
예제 #9
0
        private bool GenerateFoodCategoryList(IListSheet listSheet)
        {
            bool   succeed       = true;
            string pageSourceDir = this.RunPage.GetDetailSourceFileDir();

            string[] resultColumns = new string[] { "detailPageUrl",
                                                    "detailPageName",
                                                    "cookie",
                                                    "grabStatus",
                                                    "giveUpGrab",
                                                    "category1Code",
                                                    "category2Code",
                                                    "category3Code",
                                                    "category1Name",
                                                    "category2Name",
                                                    "category3Name" };
            Dictionary <string, int> categoryColumnDic = CommonUtil.InitStringIndexDic(resultColumns);
            string      readDetailDir    = this.RunPage.GetReadFileDir();
            string      exportDir        = this.RunPage.GetExportDir();
            string      categoryFilePath = Path.Combine(exportDir, this.RunPage.Project.Name + "_EveryCategoryFirstPage.xlsx");
            ExcelWriter categoryCW       = new ExcelWriter(categoryFilePath, "List", categoryColumnDic);

            GenerateFoodCategoryList(listSheet, pageSourceDir, categoryCW, "http://www.yummy77.com");

            categoryCW.SaveToDisk();

            //执行后续任务
            TaskManager.StartTask("易果", "美味77列表页首页", categoryFilePath, null, null, false);

            return(succeed);
        }
        public static SharePointSiteDiskSpace[] CalculateSharePointSitesDiskSpace(int itemId, out int errorCode)
        {
            SharePointSiteDiskSpace[] retDiskSpace = null;
            errorCode = 0;
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                errorCode = accountCheck;
                return(null);
            }

            // place log record
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "CALCULATE_DISK_SPACE", itemId);

            try
            {
                Organization org = (Organization)PackageController.GetPackageItem(itemId);
                if (org == null)
                {
                    return(null);
                }

                int serviceId = GetHostedSharePointServiceId(org.PackageId);

                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId);

                List <SharePointEnterpriseSiteCollection> currentOrgSiteCollection =
                    GetOrganizationSharePointEnterpriseSiteCollections(org.Id);

                List <string> urls = new List <string>();
                foreach (SharePointEnterpriseSiteCollection siteCollection in currentOrgSiteCollection)
                {
                    urls.Add(siteCollection.PhysicalAddress);
                }
                if (urls.Count > 0)
                {
                    retDiskSpace = hostedSharePointServer.Enterprise_CalculateSiteCollectionsDiskSpace(urls.ToArray());
                }
                else
                {
                    retDiskSpace              = new SharePointSiteDiskSpace[1];
                    retDiskSpace[0]           = new SharePointSiteDiskSpace();
                    retDiskSpace[0].DiskSpace = 0;
                    retDiskSpace[0].Url       = string.Empty;
                }
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
            return(retDiskSpace);
        }
예제 #11
0
        private void SetupForm_Load(object sender, EventArgs e)
        {
            NotifyIcon.Icon = Properties.Resources.SubSync_Logo;
            NotifyIcon.Text = AppCompleteDescription;

            LbWelcomeTitle.Text   = L10n.Get("LbWelcomeTitle.Text", this, AppShortDescription);
            LbWelcomeMessage.Text = L10n.Get("LbWelcomeMessage.Text", this, AppName);

            BtnStartStop.Text = L10n.Get("AppStart", AppName);

            NotifyIconContextMenuItemStartStop.Text  = L10n.Get("MenuAppStart", AppName);
            NotifyIconContextMenuItemAbout.Text      = L10n.Get("NotifyIconContextMenuItemAbout.Text", this, AppName);
            NotifyIconContextMenuItemOpenGUI.Text    = L10n.Get("NotifyIconContextMenuItemOpenGUI.Text", this, AppName);
            NotifyIconContextMenuItemRunAtLogin.Text = L10n.Get("NotifyIconContextMenuItemRunAtLogin.Text", this, AppName);

            if (SubSync.Lib.Configuration.RunningEnvironment == "Debug")
            {
                Text = string.Format("{0} [{1}]", AppCompleteDescription, SubSync.Lib.Configuration.RunningEnvironment);
            }
            else
            {
                Text = AppCompleteDescription;
            }

            Icon = Properties.Resources.SubSync_Logo;

            if (Settings.FirstRun)
            {
                Settings.MediaFolders = GetDefaultFolders();
                Settings.SubtitleLanguagesPreference = GetDefaultLanguages();

                Settings.FirstRun = false;

                Settings.Save();
            }

            SetupSyncManager();

            LoadSupportedLanguages();

            FillSettingsInfo();

            CheckStartButton();

            TaskManager.StartTask <CheckForUpdatesJob>();
            TaskManager.StartTask <CheckInternetAvailabilityJob>();

            if (StartupArgs.InitializeInStartState && IsConfigurationOk())
            {
                StartStopSync();
            }

            if (StartupArgs.InitializeInTray)
            {
                Hide();
            }
        }
 public ActionResult ReportCreate_ConfirmSaveDirectMethod(string sNowWatchIDs, string sNewWatchIDs)
 {
     if (sNowWatchIDs == "")
     {
         SetHiddenValue("ReportCreate_NowWatchIDs", sNewWatchIDs);
         TaskManager task = this.GetCmp <TaskManager>("ReportCreate_Task");
         task.StartTask("ServerTime");
     }
     else
     {
         SetHiddenValue("ReportCreate_NowWatchIDs", sNowWatchIDs + "," + sNewWatchIDs);
     }
     return(this.Direct());
 }
예제 #13
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         if (!isStand)
         {
             minimapPointer.SetActive(true);
             isStand = true;
             if (!isZombie)
             {
                 Debug.Log("Parasite set active");
                 taskManager.StartTask(new StandUpTask(taskManager, GetComponent <Animator>(), 8));
                 taskManager.StartTask(new WalkTask(taskManager, GetComponent <Animator>(), GetComponent <NavMeshAgent>(), Target.position, panel));
             }
             else
             {
                 Debug.Log("Zombie set active");
                 taskManager.StartTask(new StandUpTask(taskManager, GetComponent <Animator>(), 4));
                 taskManager.StartTask(new WalkTask(taskManager, GetComponent <Animator>(), GetComponent <NavMeshAgent>(), Target.position, panel));
             }
         }
     }
 }
예제 #14
0
 public static void SetUserGeneralSettings(int itemId, string instanceId, bool enabledForFederation, bool enabledForPublicIMConnectivity, bool archiveInternalCommunications, bool archiveFederatedCommunications, bool enabledForEnhancedPresence)
 {
     TaskManager.StartTask("OCS", "SET_OCS_USER_GENERAL_SETTINGS");
     try
     {
         OCSServer ocs = GetOCSProxy(itemId);
         ocs.SetUserGeneralSettings(instanceId, enabledForFederation, enabledForPublicIMConnectivity,
                                    archiveInternalCommunications, archiveFederatedCommunications,
                                    enabledForEnhancedPresence);
     }
     catch (Exception ex)
     {
         throw TaskManager.WriteError(ex);
     }
     TaskManager.CompleteTask();
 }
예제 #15
0
        public static int UpdateLyncUserPlan(int itemID, LyncUserPlan lyncUserPlan)
        {
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // place log record
            TaskManager.StartTask("LYNC", "ADD_LYNC_LYNCUSERPLAN", itemID);

            try
            {
                Organization org = GetOrganization(itemID);
                if (org == null)
                {
                    return(-1);
                }

                // load package context
                PackageContext cntx = PackageController.GetPackageContext(org.PackageId);

                lyncUserPlan.Conferencing    = lyncUserPlan.Conferencing & Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue);
                lyncUserPlan.EnterpriseVoice = lyncUserPlan.EnterpriseVoice & Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ENTERPRISEVOICE].QuotaAllocatedValue);
                if (!lyncUserPlan.EnterpriseVoice)
                {
                    lyncUserPlan.VoicePolicy = LyncVoicePolicyType.None;
                }
                lyncUserPlan.IM = true;

                DataProvider.UpdateLyncUserPlan(itemID, lyncUserPlan);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }


            return(0);
        }
예제 #16
0
        public static OCSUser GetUserGeneralSettings(int itemId, string instanceId)
        {
            TaskManager.StartTask("OCS", "GET_OCS_USER_GENERAL_SETTINGS");

            OCSUser user;

            try
            {
                OCSServer ocs = GetOCSProxy(itemId);
                user = ocs.GetUserGeneralSettings(instanceId);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            TaskManager.CompleteTask();
            return(user);
        }
예제 #17
0
        public static LyncUser GetLyncUserGeneralSettings(int itemId, int accountId)
        {
            TaskManager.StartTask("LYNC", "GET_LYNC_USER_GENERAL_SETTINGS");

            LyncUser user = null;

            try
            {
                Organization org = (Organization)PackageController.GetPackageItem(itemId);
                if (org == null)
                {
                    throw new ApplicationException(
                              string.Format("Organization is null. ItemId={0}", itemId));
                }

                int        lyncServiceId = GetLyncServiceID(org.PackageId);
                LyncServer lync          = GetLyncServer(lyncServiceId, org.ServiceId);

                OrganizationUser usr;
                usr = OrganizationController.GetAccount(itemId, accountId);

                if (usr != null)
                {
                    user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName);
                }

                if (user != null)
                {
                    LyncUserPlan plan = ObjectUtils.FillObjectFromDataReader <LyncUserPlan>(DataProvider.GetLyncUserPlanByAccountId(accountId));

                    if (plan != null)
                    {
                        user.LyncUserPlanId   = plan.LyncUserPlanId;
                        user.LyncUserPlanName = plan.LyncUserPlanName;
                    }
                }
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            TaskManager.CompleteTask();
            return(user);
        }
예제 #18
0
        public static LyncUserPlan GetLyncUserPlan(int itemID, int lyncUserPlanId)
        {
            // place log record
            TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLAN", lyncUserPlanId);

            try
            {
                return(ObjectUtils.FillObjectFromDataReader <LyncUserPlan>(
                           DataProvider.GetLyncUserPlan(lyncUserPlanId)));
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #19
0
        public static List <LyncUserPlan> GetLyncUserPlans(int itemId)
        {
            // place log record
            TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLANS", itemId);

            try
            {
                List <LyncUserPlan> plans = new List <LyncUserPlan>();

                UserInfo user = ObjectUtils.FillObjectFromDataReader <UserInfo>(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId));

                if (user.Role == UserRole.User)
                {
                    LyncController.GetLyncUserPlansByUser(itemId, user, ref plans);
                }
                else
                {
                    LyncController.GetLyncUserPlansByUser(0, user, ref plans);
                }


                ExchangeOrganization ExchangeOrg = ObjectUtils.FillObjectFromDataReader <ExchangeOrganization>(DataProvider.GetExchangeOrganization(itemId));

                if (ExchangeOrg != null)
                {
                    foreach (LyncUserPlan p in plans)
                    {
                        p.IsDefault = (p.LyncUserPlanId == ExchangeOrg.LyncUserPlanID);
                    }
                }


                return(plans);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #20
0
        public static SfBUserPlan GetSfBUserPlan(int itemID, int sfbUserPlanId)
        {
            // place log record
            TaskManager.StartTask("SFB", "GET_SFB_SFBUSERPLAN", sfbUserPlanId);

            try
            {
                return(ObjectUtils.FillObjectFromDataReader <SfBUserPlan>(
                           DataProvider.GetSfBUserPlan(sfbUserPlanId)));
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #21
0
        public static int AddSfBUserPlan(int itemID, SfBUserPlan sfbUserPlan)
        {
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // place log record
            TaskManager.StartTask("SFB", "ADD_SFB_SFBUSERPLAN", itemID);

            try
            {
                Organization org = GetOrganization(itemID);
                if (org == null)
                {
                    return(-1);
                }

                // load package context
                PackageContext cntx = PackageController.GetPackageContext(org.PackageId);

                sfbUserPlan.Conferencing    = sfbUserPlan.Conferencing & Convert.ToBoolean(cntx.Quotas[Quotas.SFB_CONFERENCING].QuotaAllocatedValue);
                sfbUserPlan.EnterpriseVoice = sfbUserPlan.EnterpriseVoice & Convert.ToBoolean(cntx.Quotas[Quotas.SFB_ENTERPRISEVOICE].QuotaAllocatedValue);
                if (!sfbUserPlan.EnterpriseVoice)
                {
                    sfbUserPlan.VoicePolicy = SfBVoicePolicyType.None;
                }
                sfbUserPlan.IM = true;

                return(DataProvider.AddSfBUserPlan(itemID, sfbUserPlan));
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
        public static void UpdateQuota(int itemId, int siteCollectionId, int maxStorage, int warningStorage)
        {
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "UPDATE_QUOTA");
            try
            {
                Organization org = (Organization)PackageController.GetPackageItem(itemId);
                if (org == null)
                {
                    return;
                }

                int serviceId = GetHostedSharePointServiceId(org.PackageId);

                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId);

                SharePointEnterpriseSiteCollection sc = GetSiteCollection(siteCollectionId);

                int maxSize     = RecalculateMaxSize(org.MaxSharePointEnterpriseStorage, maxStorage);
                int warningSize = warningStorage;


                sc.MaxSiteStorage = maxSize;
                sc.WarningStorage = maxSize == -1 ? -1 : Math.Min(warningSize, maxSize);
                PackageController.UpdatePackageItem(sc);

                hostedSharePointServer.Enterprise_UpdateQuotas(sc.PhysicalAddress, maxSize,
                                                               warningStorage);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #23
0
 public void TriggerTaskHandler(bool specialTask)
 {
     taskManager.StartTask(specialTask);
 }
예제 #24
0
        private bool GetAllDetailPageUrl(IListSheet listSheet)
        {
            string exportDir     = this.RunPage.GetExportDir();
            string pageSourceDir = this.RunPage.GetDetailSourceFileDir();

            Dictionary <string, int> resultColumnDic = new Dictionary <string, int>();

            resultColumnDic.Add("detailPageUrl", 0);
            resultColumnDic.Add("detailPageName", 1);
            resultColumnDic.Add("cookie", 2);
            resultColumnDic.Add("grabStatus", 3);
            resultColumnDic.Add("giveUpGrab", 4);
            resultColumnDic.Add("productCode", 5);
            resultColumnDic.Add("productName", 6);
            resultColumnDic.Add("productCurrentPrice", 7);
            resultColumnDic.Add("productOldPrice", 8);
            resultColumnDic.Add("category1Code", 9);
            resultColumnDic.Add("category2Code", 10);
            resultColumnDic.Add("category3Code", 11);
            resultColumnDic.Add("category1Name", 12);
            resultColumnDic.Add("category2Name", 13);
            resultColumnDic.Add("category3Name", 14);
            resultColumnDic.Add("standard", 15);
            string      resultFilePath = Path.Combine(exportDir, this.RunPage.Project.Name + "_AllDetailPageUrl.xlsx");
            ExcelWriter resultEW       = new ExcelWriter(resultFilePath, "List", resultColumnDic);

            Dictionary <string, string> allProductCodes = new Dictionary <string, string>();

            string detailPageUrlColumnName = SysConfig.DetailPageUrlFieldName;
            string categoryNameColumnName  = SysConfig.DetailPageNameFieldName;

            for (int i = 0; i < listSheet.RowCount; i++)
            {
                Dictionary <string, string> row = listSheet.GetRow(i);
                bool giveUp = "Y".Equals(row[SysConfig.GiveUpGrabFieldName]);
                if (!giveUp)
                {
                    string url                 = row[detailPageUrlColumnName];
                    string category1Code       = row["category1Code"];
                    string category2Code       = row["category2Code"];
                    string category3Code       = row["category3Code"];
                    string category1Name       = row["category1Name"];
                    string category2Name       = row["category2Name"];
                    string category3Name       = row["category3Name"];
                    string detailPageUrlPrefix = "http://www.yummy77.com";
                    string localFilePath       = this.RunPage.GetFilePath(url, pageSourceDir);

                    try
                    {
                        HtmlAgilityPack.HtmlDocument htmlDoc = this.RunPage.GetLocalHtmlDocument(listSheet, i);
                        HtmlNode listNode = htmlDoc.DocumentNode.SelectSingleNode("//div[@class=\"productlist\"]");
                        if (listNode != null)
                        {
                            //HtmlNodeCollection allPageNodes = listNode.SelectNodes("./div[@class='p_item_container p_item_ab ']");
                            HtmlNodeCollection allPageNodes = listNode.SelectNodes("./div");
                            if (allPageNodes != null)
                            {
                                foreach (HtmlNode pagesNode in allPageNodes)
                                {
                                    HtmlNodeCollection pageItemList = pagesNode.SelectNodes("./div");
                                    foreach (HtmlNode pageNode in pageItemList)
                                    {
                                        string productCode         = "";
                                        string productName         = "";
                                        string productCurrentPrice = "";
                                        string productOldPrice     = "";
                                        string detailPageUrl       = "";
                                        string detailPageName      = "";
                                        string standard            = "";

                                        HtmlNode nameNode = pageNode.SelectSingleNode("./span[@class=\"pname_div\"]/a");
                                        detailPageUrl = detailPageUrlPrefix + nameNode.Attributes["href"].Value;
                                        int startIndex = detailPageUrl.LastIndexOf("/") + 1;
                                        int endIndex   = detailPageUrl.LastIndexOf(".");
                                        int length     = endIndex - startIndex;

                                        //商品类型为礼品卡时,length==0,不用获取详情页
                                        if (length > 0)
                                        {
                                            detailPageName = detailPageUrl.Substring(startIndex, length);
                                            productCode    = detailPageName;
                                            productName    = nameNode.InnerText.Trim();

                                            HtmlNode pcNode = pageNode.SelectSingleNode("./span[@class=\"price_div\"]/span[@class=\"pcprice_sp\"]");
                                            if (pcNode != null)
                                            {
                                                productCurrentPrice = pcNode.InnerText.Trim().Substring(1);
                                            }

                                            HtmlNode pmNode = pageNode.SelectSingleNode("./span[@class=\"price_div\"]/span[@class=\"pmprice_sp\"]");
                                            if (pmNode != null)
                                            {
                                                productOldPrice = pmNode.InnerText.Trim().Substring(1);
                                            }

                                            HtmlNode standardNode = pageNode.SelectSingleNode("./div[@class=\"p_item_mark\"]/ul/li[@_pid=\"" + productCode + "\"]");
                                            if (standardNode != null)
                                            {
                                                standard = standardNode.InnerText.Trim();
                                            }

                                            if (!allProductCodes.ContainsKey(productCode))
                                            {
                                                allProductCodes.Add(productCode, null);
                                                Dictionary <string, string> p2vs = new Dictionary <string, string>();
                                                p2vs.Add("detailPageUrl", detailPageUrl);
                                                p2vs.Add("detailPageName", detailPageName);
                                                p2vs.Add("productCode", productCode);
                                                p2vs.Add("productName", productName);
                                                p2vs.Add("productCurrentPrice", productCurrentPrice);
                                                p2vs.Add("productOldPrice", productOldPrice);
                                                p2vs.Add("category1Code", category1Code);
                                                p2vs.Add("category2Code", category2Code);
                                                p2vs.Add("category3Code", category3Code);
                                                p2vs.Add("category1Name", category1Name);
                                                p2vs.Add("category2Name", category2Name);
                                                p2vs.Add("category3Name", category3Name);
                                                p2vs.Add("standard", standard);
                                                resultEW.AddRow(p2vs);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        this.RunPage.InvokeAppendLogText("读取出错.  " + ex.Message + " LocalPath = " + localFilePath, LogLevelType.Error, true);
                        throw ex;
                    }
                }
            }
            resultEW.SaveToDisk();

            //执行后续任务
            TaskManager.StartTask("易果", "美味77获取所有详情页", resultFilePath, null, null, false);

            return(true);
        }
        public static int SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // place log record
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "SET_ORG_LIMITS", itemId);

            try
            {
                Organization org = (Organization)PackageController.GetPackageItem(itemId);
                if (org == null)
                {
                    return(0);
                }

                // set limits
                int realMaxSizeValue = RecalculateStorageMaxSize(maxStorage, org.PackageId);

                org.MaxSharePointEnterpriseStorage = realMaxSizeValue;

                org.WarningSharePointEnterpriseStorage = realMaxSizeValue == -1 ? -1 : Math.Min(warningStorage, realMaxSizeValue);

                // save organization
                UpdateOrganization(org);

                if (applyToSiteCollections)
                {
                    int serviceId = GetHostedSharePointServiceId(org.PackageId);

                    HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId);

                    List <SharePointEnterpriseSiteCollection> currentOrgSiteCollection =
                        GetOrganizationSharePointEnterpriseSiteCollections(org.Id);


                    foreach (SharePointEnterpriseSiteCollection siteCollection in currentOrgSiteCollection)
                    {
                        try
                        {
                            SharePointEnterpriseSiteCollection sc = GetSiteCollection(siteCollection.Id);
                            sc.MaxSiteStorage = realMaxSizeValue;
                            sc.WarningStorage = realMaxSizeValue == -1 ? -1 : warningStorage;
                            PackageController.UpdatePackageItem(sc);

                            hostedSharePointServer.Enterprise_UpdateQuotas(siteCollection.PhysicalAddress, realMaxSizeValue,
                                                                           warningStorage);
                        }
                        catch (Exception ex)
                        {
                            TaskManager.WriteError(ex);
                        }
                    }
                }

                return(0);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
        /// <summary>
        /// Restores SharePoint site collection.
        /// </summary>
        /// <param name="itemId">Site collection id within metabase.</param>
        /// <param name="uploadedFile"></param>
        /// <param name="packageFile"></param>
        /// <returns></returns>
        public static int RestoreSiteCollection(int itemId, string uploadedFile, string packageFile)
        {
            // Check account.
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // Load original meta item.
            SharePointEnterpriseSiteCollection origItem = (SharePointEnterpriseSiteCollection)PackageController.GetPackageItem(itemId);

            if (origItem == null)
            {
                return(BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_NOT_FOUND);
            }

            // Check package.
            int packageCheck = SecurityContext.CheckPackage(origItem.PackageId, DemandPackage.IsActive);

            if (packageCheck < 0)
            {
                return(packageCheck);
            }

            // Log operation.
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "BACKUP_SITE_COLLECTION", origItem.Name, itemId);

            try
            {
                // Create site collection on server.
                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(origItem.ServiceId);

                string backupFile = null;
                if (!String.IsNullOrEmpty(packageFile))
                {
                    // Copy package files to the remote SharePoint Server.
                    string path   = null;
                    byte[] buffer = null;

                    int offset = 0;
                    do
                    {
                        // Read package file.
                        buffer = FilesController.GetFileBinaryChunk(origItem.PackageId, packageFile, offset, FILE_BUFFER_LENGTH);

                        // Write remote backup file
                        string tempPath = hostedSharePointServer.Enterprise_AppendTempFileBinaryChunk(Path.GetFileName(packageFile), path, buffer);
                        if (path == null)
                        {
                            path       = tempPath;
                            backupFile = path;
                        }

                        offset += FILE_BUFFER_LENGTH;
                    }while (buffer.Length == FILE_BUFFER_LENGTH);
                }
                else if (!String.IsNullOrEmpty(uploadedFile))
                {
                    // Upladed files.
                    backupFile = uploadedFile;
                }

                // Restore.
                if (!String.IsNullOrEmpty(backupFile))
                {
                    hostedSharePointServer.Enterprise_RestoreSiteCollection(origItem, backupFile);
                }

                return(0);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
        /// <summary>
        /// Backups SharePoint site collection.
        /// </summary>
        /// <param name="itemId">Site collection id within metabase.</param>
        /// <param name="fileName">Backed up site collection file name.</param>
        /// <param name="zipBackup">A value which shows whether back up must be archived.</param>
        /// <param name="download">A value which shows whether created back up must be downloaded.</param>
        /// <param name="folderName">Local folder to store downloaded backup.</param>
        /// <returns>Created backup file name. </returns>
        public static string BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName)
        {
            // Check account.
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(null);
            }

            // Load original meta item
            SharePointEnterpriseSiteCollection origItem = (SharePointEnterpriseSiteCollection)PackageController.GetPackageItem(itemId);

            if (origItem == null)
            {
                return(null);
            }

            // Log operation.
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "BACKUP_SITE_COLLECTION", origItem.Name, itemId);

            try
            {
                // Create site collection on server.
                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(origItem.ServiceId);
                string backFile = hostedSharePointServer.Enterprise_BackupSiteCollection(origItem.Name, fileName, zipBackup);

                if (!download)
                {
                    // Copy backup files to space folder.
                    string relFolderName = FilesController.CorrectRelativePath(folderName);
                    if (!relFolderName.EndsWith("\\"))
                    {
                        relFolderName = relFolderName + "\\";
                    }

                    // Create backup folder if not exists
                    if (!FilesController.DirectoryExists(origItem.PackageId, relFolderName))
                    {
                        FilesController.CreateFolder(origItem.PackageId, relFolderName);
                    }

                    string packageFile = relFolderName + Path.GetFileName(backFile);

                    // Delete destination file if exists
                    if (FilesController.FileExists(origItem.PackageId, packageFile))
                    {
                        FilesController.DeleteFiles(origItem.PackageId, new string[] { packageFile });
                    }

                    byte[] buffer = null;

                    int offset = 0;
                    do
                    {
                        // Read remote content.
                        buffer = hostedSharePointServer.Enterprise_GetTempFileBinaryChunk(backFile, offset, FILE_BUFFER_LENGTH);

                        // Write remote content.
                        FilesController.AppendFileBinaryChunk(origItem.PackageId, packageFile, buffer);

                        offset += FILE_BUFFER_LENGTH;
                    }while (buffer.Length == FILE_BUFFER_LENGTH);
                }

                return(backFile);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
        /// <summary>
        /// Deletes SharePoint site collection with given id.
        /// </summary>
        /// <param name="itemId">Site collection id within metabase.</param>
        /// <returns>?</returns>
        public static int DeleteSiteCollection(int itemId)
        {
            // Check account.
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // Load original meta item
            SharePointEnterpriseSiteCollection origItem = (SharePointEnterpriseSiteCollection)PackageController.GetPackageItem(itemId);

            if (origItem == null)
            {
                return(BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_NOT_FOUND);
            }

            // Get service settings.
            StringDictionary hostedSharePointSettings = ServerController.GetServiceSettings(origItem.ServiceId);
            Uri    rootWebApplicationUri = new Uri(hostedSharePointSettings["RootWebApplicationUri"]);
            string siteName = origItem.Name.Replace(String.Format("{0}://", rootWebApplicationUri.Scheme), String.Empty);

            // Log operation.
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "DELETE_SITE", origItem.Name, itemId);

            try
            {
                // Delete site collection on server.
                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(origItem.ServiceId);
                hostedSharePointServer.Enterprise_DeleteSiteCollection(origItem);
                // Delete record in metabase.
                PackageController.DeletePackageItem(origItem.Id);

                int dnsServiceId = PackageController.GetPackageServiceId(origItem.PackageId, ResourceGroups.Dns);
                if (dnsServiceId > 0)
                {
                    string[] tmpStr     = siteName.Split('.');
                    string   hostName   = tmpStr[0];
                    string   domainName = siteName.Substring(hostName.Length + 1, siteName.Length - (hostName.Length + 1));

                    List <GlobalDnsRecord> dnsRecords      = ServerController.GetDnsRecordsByService(origItem.ServiceId);
                    List <DnsRecord>       resourceRecords = DnsServerController.BuildDnsResourceRecords(dnsRecords, hostName, domainName, "");
                    DNSServer dns = new DNSServer();

                    ServiceProviderProxy.Init(dns, dnsServiceId);
                    // add new resource records
                    dns.DeleteZoneRecords(domainName, resourceRecords.ToArray());
                }

                return(0);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
        /// <summary>
        /// Adds SharePoint site collection.
        /// </summary>
        /// <param name="item">Site collection description.</param>
        /// <returns>Created site collection id within metabase.</returns>
        public static int AddSiteCollection(SharePointEnterpriseSiteCollection item)
        {
            // Check account.
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);

            if (accountCheck < 0)
            {
                return(accountCheck);
            }

            // Check package.
            int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);

            if (packageCheck < 0)
            {
                return(packageCheck);
            }

            // Check quota.
            OrganizationStatistics orgStats = OrganizationController.GetOrganizationStatistics(item.OrganizationId);

            //QuotaValueInfo quota = PackageController.GetPackageQuota(item.PackageId, Quotas.HOSTED_SHAREPOINT_SITES);

            if (orgStats.AllocatedSharePointEnterpriseSiteCollections > -1 &&
                orgStats.CreatedSharePointEnterpriseSiteCollections >= orgStats.AllocatedSharePointEnterpriseSiteCollections)
            {
                return(BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_QUOTA_LIMIT);
            }

            // Check if stats resource is available
            int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.SharepointEnterpriseServer);

            if (serviceId == 0)
            {
                return(BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_UNAVAILABLE);
            }

            StringDictionary hostedSharePointSettings = ServerController.GetServiceSettings(serviceId);
            QuotaValueInfo   quota             = PackageController.GetPackageQuota(item.PackageId, Quotas.HOSTED_SHAREPOINT_ENTERPRISE_USESHAREDSSL);
            Uri          rootWebApplicationUri = new Uri(hostedSharePointSettings["RootWebApplicationUri"]);
            Organization org      = OrganizationController.GetOrganization(item.OrganizationId);
            string       siteName = item.Name;

            if (quota.QuotaAllocatedValue == 1)
            {
                string sslRoot = hostedSharePointSettings["SharedSSLRoot"];


                string defaultDomain = org.DefaultDomain;
                string hostNameBase  = string.Empty;

                string[] tmp = defaultDomain.Split('.');
                if (tmp.Length == 2)
                {
                    hostNameBase = tmp[0];
                }
                else
                {
                    if (tmp.Length > 2)
                    {
                        hostNameBase = tmp[0] + tmp[1];
                    }
                }

                int counter = 0;
                item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, hostNameBase + "-" + counter.ToString() + "." + sslRoot);
                siteName  = String.Format("{0}", hostNameBase + "-" + counter.ToString() + "." + sslRoot);

                while (DataProvider.CheckServiceItemExists(serviceId, item.Name, "WebsitePanel.Providers.SharePoint.SharePointEnterpriseSiteCollection,   WebsitePanel.Providers.Base"))
                {
                    counter++;
                    item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, hostNameBase + "-" + counter.ToString() + "." + sslRoot);
                    siteName  = String.Format("{0}", hostNameBase + "-" + counter.ToString() + "." + sslRoot);
                }
            }
            else
            {
                item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, item.Name);
            }

            if (rootWebApplicationUri.Port > 0 && rootWebApplicationUri.Port != 80 && rootWebApplicationUri.Port != 443)
            {
                item.PhysicalAddress = String.Format("{0}:{1}", item.Name, rootWebApplicationUri.Port);
            }
            else
            {
                item.PhysicalAddress = item.Name;
            }

            if (Utils.ParseBool(hostedSharePointSettings["LocalHostFile"], false))
            {
                item.RootWebApplicationInteralIpAddress = hostedSharePointSettings["RootWebApplicationInteralIpAddress"];
                item.RootWebApplicationFQDN             = item.Name.Replace(rootWebApplicationUri.Scheme + "://", "");
            }

            item.MaxSiteStorage = RecalculateMaxSize(org.MaxSharePointEnterpriseStorage, (int)item.MaxSiteStorage);
            item.WarningStorage = item.MaxSiteStorage == -1 ? -1 : Math.Min((int)item.WarningStorage, item.MaxSiteStorage);


            // Check package item with given name already exists.
            if (PackageController.GetPackageItemByName(item.PackageId, item.Name, typeof(SharePointEnterpriseSiteCollection)) != null)
            {
                return(BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_EXISTS);
            }

            // Log operation.
            TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "ADD_SITE_COLLECTION", item.Name);

            try
            {
                // Create site collection on server.
                HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId);

                hostedSharePointServer.Enterprise_CreateSiteCollection(item);

                // Make record in metabase.
                item.ServiceId = serviceId;
                int itemId = PackageController.AddPackageItem(item);

                hostedSharePointServer.Enterprise_SetPeoplePickerOu(item.Name, org.DistinguishedName);

                int dnsServiceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.Dns);
                if (dnsServiceId > 0)
                {
                    string[] tmpStr     = siteName.Split('.');
                    string   hostName   = tmpStr[0];
                    string   domainName = siteName.Substring(hostName.Length + 1, siteName.Length - (hostName.Length + 1));

                    List <GlobalDnsRecord> dnsRecords      = ServerController.GetDnsRecordsByService(serviceId);
                    List <DnsRecord>       resourceRecords = DnsServerController.BuildDnsResourceRecords(dnsRecords, hostName, domainName, "");
                    DNSServer dns = new DNSServer();

                    ServiceProviderProxy.Init(dns, dnsServiceId);
                    // add new resource records
                    dns.AddZoneRecords(domainName, resourceRecords.ToArray());
                }

                TaskManager.ItemId = itemId;

                return(itemId);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
예제 #30
0
        /// <summary>
        /// 添加任务
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //判断是否是“粘贴并添加”
            if (txtInput.Text.Trim() == "" && Clipboard.ContainsText())             //如果文本框为空则为“粘贴并添加”
            {
                txtInput.Text = Clipboard.GetText();
            }


            string url = txtInput.Text;

            this.Cursor = Cursors.WaitCursor;

            IPlugin selectedPlugin = null;

            //如果有可用插件
            if (supportedPlugins.Count > 0)
            {
                selectedPlugin = supportedPlugins[cboPlugins.SelectedIndex];

                //取得此url的hash
                string hash = selectedPlugin.GetHash(url);
                //检查是否有已经在进行的相同任务
                foreach (TaskInfo task in _taskMgr.TaskInfos)
                {
                    if (hash == task.Hash)
                    {
                        toolTip.Show("当前任务已经存在", txtInput, 4000);
                        this.Cursor = Cursors.Default;
                        return;
                    }
                }
                try
                {
                    //取得[代理设置]
                    AcDownProxy selectedProxy = null;
                    if (Config.setting.Proxy_Settings != null)
                    {
                        foreach (AcDownProxy item in Config.setting.Proxy_Settings)
                        {
                            if (item.Name == cboProxy.SelectedItem.ToString())
                            {
                                selectedProxy = item;
                            }
                        }
                    }

                    //取得[AutoAnswer设置]
                    List <AutoAnswer> aa = new List <AutoAnswer>();
                    if (chkAutoAnswer.Checked)
                    {
                        if (selectedPlugin.Feature.ContainsKey("AutoAnswer"))
                        {
                            aa = (List <AutoAnswer>)selectedPlugin.Feature["AutoAnswer"];
                            if (aa.Count > 0)
                            {
                                FormAutoAnswer faa = new FormAutoAnswer(aa);
                                faa.TopMost = this.TopMost;
                                var result = faa.ShowDialog();
                                if (result == System.Windows.Forms.DialogResult.Cancel)
                                {
                                    this.Cursor = Cursors.Default;
                                    return;
                                }
                            }
                        }
                    }

                    //添加任务
                    TaskInfo task = _taskMgr.AddTask(selectedPlugin,
                                                     url,
                                                     (selectedProxy == null) ? null : selectedProxy.ToWebProxy());
                    //设置[保存目录]
                    task.SaveDirectory = new DirectoryInfo(txtPath.Text);
                    //设置[字幕]
                    DownloadSubtitleType ds = DownloadSubtitleType.DownloadSubtitle;
                    if (cboDownSub.SelectedIndex == 1)
                    {
                        ds = DownloadSubtitleType.DontDownloadSubtitle;
                    }
                    if (cboDownSub.SelectedIndex == 2)
                    {
                        ds = DownloadSubtitleType.DownloadSubtitleOnly;
                    }
                    task.DownSub = ds;
                    //设置[提取浏览器缓存]
                    task.ExtractCache = chkExtractCache.Checked;
                    //设置[解析关联视频]
                    task.ParseRelated = chkParseRelated.Checked;
                    //设置[自动应答]
                    task.AutoAnswer = aa;
                    //设置注释
                    task.Comment = txtComment.Text;


                    //开始下载
                    _taskMgr.StartTask(task);


                    this.Cursor = Cursors.Default;
                    this.Close();
                }
                catch (Exception ex)
                {
                    Logging.Add(ex);
                    toolTip.Show("新建任务出现错误:\n" + ex.Message, btnAdd, 4000);
                }
            }
            else
            {
                toolTip.Show("您所输入的网络地址(URL)不符合规则。\n没有支持解析此网址的插件,请您检查后重新输入", txtInput, 3000);
                txtInput.SelectAll();
            }
            this.Cursor = Cursors.Default;
        }