コード例 #1
0
        protected void OnEdit(object sender, EventArgs e)
        {
            //Find the reference of the Repeater Item.
            try
            {
                //Check for password file of store
                string filePath = "";
                txtEditName.Text    = "";
                txtEditPackage.Text = "";
                txtEditVersion.Text = "";

                filePath = ConfigurationManager.AppSettings["Store_Directory"].ToString();
                if (System.IO.File.Exists(filePath + "\\" + Session["SubDomain"].ToString() + "\\password.txt"))
                {
                    if (Session["StoreUserName"] == null)
                    {
                        Notification("Login to Edit APP.", "error");
                        return;
                    }
                }

                RepeaterItem item = (sender as LinkButton).Parent as RepeaterItem;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Msg", "ShowModal('" + (item.FindControl("lblApkName") as Label).Text.Trim() +
                                                        "','" + (item.FindControl("hiddenName") as HiddenField).Value.Trim() +
                                                        "','" + (item.FindControl("hiddenPackage") as HiddenField).Value.Trim() +
                                                        "','" + (item.FindControl("hiddenVersion") as HiddenField).Value.Trim() + "');", true);
            }
            catch (Exception ex)
            {
                Notification("Error at OnEdit", "error");
                ClsLog.LogException(ex, "Error at Client Store Home-->OnEdit");
            }
            //this.ToggleElements(item, true);
        }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             //string DomainName = "bonrix.myappstore.co.in";
             //ClsLog.Url_Log("Request", "Url --> " + HttpContext.Current.Request.Url.ToString());
             string DomainName = HttpContext.Current.Request.Url.Host;
             //ClsLog.Url_Log("Request ", "DomainName--> " + DomainName);
             if (DomainName.Contains("."))
             {
                 string[] spltDomain = DomainName.Split('.');
                 subDomain            = spltDomain[0].ToString();
                 Session["SubDomain"] = subDomain;
                 //ClsLog.Url_Log("Request", "Sub Domain Name--> " + subDomain);
                 divTitle.InnerText = subDomain.ToUpper() + " APP STORE";
                 LoadStore(subDomain);
             }
         }
     }
     catch (Exception ex)
     {
         ClsLog.LogException(ex, "Error at Page Client Store Home-->OnLoad");
         Notification("Error at Page Client Store Home OnLoad", "error");
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             if (Session["StoreUserName"] == null)
             {
                 Response.Redirect("~/Admin/Login.aspx", false);
             }
             else
             {
                 B2CNameRight.InnerText = " " + Session["StoreUserName"].ToString();
                 B2CNameLeft.InnerText  = " " + Session["StoreUserName"].ToString();
             }
         }
         catch (Exception ex)
         {
             ClsLog.LogException(ex, "Error at Page Master-->Page_Load");
         }
     }
     else
     {
         if (Session["StoreUserName"] == null)
         {
             Response.Redirect("~/Admin/Login.aspx", false);
         }
     }
 }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    //string DomainName = "www.myappstore.co.in";
                    string DomainName = HttpContext.Current.Request.Url.Host;
                    string MainDomain = ConfigurationManager.AppSettings["MainDomain"].ToString();
                    DomainName = DomainName.Replace("www.", "");
                    if (DomainName != MainDomain)
                    {
                        string Details_Directory    = ConfigurationManager.AppSettings["Details_Directory"].ToString();
                        string getDetails_Directory = System.IO.File.ReadAllText(Details_Directory + "details.txt");
                        var    details = JObject.Parse(getDetails_Directory);

                        string domain = details["domain"].ToString().Replace("\"", "").Trim();
                        DomainName = DomainName.Replace("." + MainDomain.ToString(), "");
                        //DomainName = DomainName.Replace("www.", "");
                        Response.Redirect("http://" + DomainName + domain + "/ClientStore/Home.aspx", false);
                    }
                    else
                    {
                        LoadCards();
                    }
                }
            }
            catch (Exception ex)
            {
                ClsLog.LogException(ex, "Error at Page Store Home-->OnLoad");
                Notification("Error at Page Store Home OnLoad", "error");
            }
        }
コード例 #5
0
        protected void OnDelete(object sender, EventArgs e)
        {
            try
            {
                RepeaterItem item       = (sender as LinkButton).Parent as RepeaterItem;
                string       lblApkName = (item.FindControl("lblApkName") as Label).Text.Trim();

                string StoreDirectory = ConfigurationManager.AppSettings["Store_Directory"].ToString();
                StoreDirectory = StoreDirectory + "\\" + Session["SubDomain"].ToString() + "\\APP\\" + lblApkName;

                File.Delete(StoreDirectory);

                StoreDirectory = ConfigurationManager.AppSettings["Store_Directory"].ToString() + "\\" + Session["SubDomain"].ToString() + "\\APP\\" + lblApkName.Substring(0, lblApkName.Length - 4) + ".txt";
                if (File.Exists(StoreDirectory))
                {
                    File.Delete(StoreDirectory);
                }

                Notification("Deleted Successfully", "success");
                LoadStore(Session["SubDomain"].ToString());
            }
            catch (Exception ex)
            {
                Notification("Error at OnDelete", "danger");
                ClsLog.LogException(ex, "Error at Page StoreList-->OnDelete");
            }
        }
コード例 #6
0
        public string SubmitPayment(string meterNo, string amt, string dealerName, string custName, string custAddress, string crCode, string fixedCharge2,
                                    string conlogTID, string password, string mtid, string channelRefNo, string collectionType = "NRG", string invoiceNo = "", string businessUnit = "")
        {
            string    errorMsg = "";
            ClsLog    cl       = new ClsLog();
            ClsDealer dl       = new ClsDealer();

            if (dl.ChannelRefExists(channelRefNo))
            {
                return("0|Get receipt from payment history");
            }

            if (RequestIsValid(dealerName, password))
            {
                return(pawakadApp.PwkRESTWS.utilClass.SubmitPayment.PerformPayment(meterNo, amt, dealerName, custName, custAddress, crCode, fixedCharge2,
                                                                                   conlogTID, password, mtid, channelRefNo, collectionType, invoiceNo, businessUnit));
            }
            else
            {
                errorMsg = "0|Invalid_Request";
                cl.LogPaymentError(meterNo, "", int.Parse(amt), errorMsg, "PAYMENT", DateTime.Now /*, dCode, DateTime.Now, false*/);

                //dl.AddLoginLocation(dealerName, longitude, latitude, address, mtid);
                return(errorMsg);
            }
        }
コード例 #7
0
        protected void OnDeleteAPK(object sender, EventArgs e)
        {
            try
            {
                RepeaterItem item          = (sender as LinkButton).Parent as RepeaterItem;
                string       lblFolderName = (item.FindControl("lblFolderName") as Label).Text.Trim();

                string StoreDirectory = ConfigurationManager.AppSettings["Store_Directory"].ToString();
                StoreDirectory = StoreDirectory + "\\" + lblFolderName + "\\StoreAPK";

                string[] subdirectoryEntries = Directory.GetFiles(StoreDirectory);
                if (subdirectoryEntries.Length > 0)
                {
                    foreach (var directory in subdirectoryEntries)
                    {
                        DirectoryInfo dirInfo = new DirectoryInfo(directory);
                        File.Delete(dirInfo.ToString());
                    }
                    //Directory.Delete(StoreDirectory, true);
                    loadData();
                    Notification("Deleted Successfully", "success");
                }
                else
                {
                    Notification("No Store Apk Uploaded.", "danger");
                }
            }
            catch (Exception ex)
            {
                Notification("Error at OnDelete", "danger");
                ClsLog.LogException(ex, "Error at Page Admin Home-->OnDelete");
            }
        }
コード例 #8
0
        protected void lnkSendSmsMain_Click(object sender, EventArgs e)
        {
            try
            {
                string ApkPath  = "";
                string linkcopy = "";

                string Details_Directory    = ConfigurationManager.AppSettings["Details_Directory"].ToString();
                string getDetails_Directory = System.IO.File.ReadAllText(Details_Directory + "details.txt");
                var    details = JObject.Parse(getDetails_Directory);

                string domain = details["domain"].ToString().Replace("\"", "").Trim();
                subDomain = Session["SubDomain"].ToString();

                ApkPath = ConfigurationManager.AppSettings["Store_Directory"].ToString() + "\\" + subDomain + "\\StoreAPK";

                string[] subdirectoryEntries = Directory.GetFiles(ApkPath, "*.apk");
                if (subdirectoryEntries.Length > 0)
                {
                    DirectoryInfo dirInfoApk = new DirectoryInfo(subdirectoryEntries[0]);
                    linkcopy = "http://" + subDomain + domain + "/Raw_Details/Store/" + subDomain + "/StoreAPK/" + dirInfoApk.Name;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Msg", "onSendSms('" + linkcopy + "');", true);
                }
            }
            catch (Exception ex)
            {
                Notification("Error at OnSendSmsMain", "error");
                ClsLog.LogException(ex, "Error at Page Client Store Home-->OnSendSmsMain");
            }
        }
コード例 #9
0
        public string SendRequest(string url)
        {
            try
            {
                HttpWebRequest request = ((HttpWebRequest)(WebRequest.Create(url)));
                request.Method          = "GET";
                request.Timeout         = 30000;
                request.PreAuthenticate = true;
                request.KeepAlive       = false;
                //webreq.ContentType = "application/x-www-form-urlencoded";
                request.ContentType = "application/json;charset=UTF-8";
                request.Credentials = CredentialCache.DefaultCredentials;
                request.UserAgent   = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

                HttpWebResponse response    = (HttpWebResponse)request.GetResponse();
                Stream          resst       = response.GetResponseStream();
                StreamReader    sr          = new StreamReader(resst);
                string          strresponse = sr.ReadToEnd();
                sr.Close();
                response.Close();
                resst.Close();

                return(strresponse);
            }
            catch (Exception ex)
            {
                ClsLog.LogException(ex, "Error at Page Client Store Home-->SendRequest");
                return(ex.ToString());
            }
        }
コード例 #10
0
        protected void btnSendSms_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtMobile.Text == "")
                {
                    Notification("Enter Mobile Number", "error");
                    return;
                }
                string Details_Directory    = ConfigurationManager.AppSettings["Details_Directory"].ToString();
                string getDetails_Directory = System.IO.File.ReadAllText(Details_Directory + "details.txt");
                var    details = JObject.Parse(getDetails_Directory);

                string smsUrl = details["smsurl"].ToString().Replace("\"", "").Trim();

                smsUrl = smsUrl.Replace("<mobileno>", txtMobile.Text);
                smsUrl = smsUrl.Replace("<message>", hiddenText.Value.ToString());
                string response = SendRequest(smsUrl);
                if (response.Contains("success"))
                {
                    Notification("Sms Sent Successfully", "success");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Msg", "onSendSms('');", true);
                }
                else
                {
                    Notification("Error in Sending Sms", "error");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Msg", "onSendSms('');", true);
                }
            }
            catch (Exception ex)
            {
                Notification("Error at btnSendSms", "error");
                ClsLog.LogException(ex, "Error at Page Client Store Home-->btnSendSms");
            }
        }
コード例 #11
0
 protected void btnEditSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         string lblFolderName  = hiddenFolderName.Value.ToString();
         string lblApkFileName = hiddenFolderApkName.Value.ToString();
         string StoreDirectory = ConfigurationManager.AppSettings["Store_Directory"].ToString();
         StoreDirectory = StoreDirectory + "\\" + hiddenFolderName.Value.ToString() + "\\StoreAPK";
         StoreDirectory = StoreDirectory + "\\" + lblApkFileName + ".txt";
         if (System.IO.File.Exists(StoreDirectory))
         {
             System.IO.File.Delete(StoreDirectory);
         }
         //Write Package file
         StreamWriter sw = new StreamWriter(StoreDirectory, true);
         sw.Write("{\"name\":\"" + txtName.Text.ToString().Trim() + "\",\"package\":\"" + txtPackageName.Text.ToString().Trim() + "\",\"version\":\"" + txtVersion.Text.ToString().Trim() + "\"}");
         sw.Close();
         Notification("Updated Successfully", "success");
     }
     catch (Exception ex)
     {
         Notification("Error at OnDelete APK", "danger");
         ClsLog.LogException(ex, "Error at Page Admin Home-->OnDelete APK");
     }
 }
コード例 #12
0
ファイル: MainContorl.cs プロジェクト: harryluo163/Spider
        public void cydaPortalAnalysis(PageContentEntity entity)
        {
            try
            {
                string    pContent = entity.PContent;
                Utilities util     = new Utilities();
                SqlBuild  sqlBuild = new SqlBuild();
                SqlPara   sqlPara  = new SqlPara();
                ClsDB     clsDB    = new ClsDB();
                RegFunc   rf       = new RegFunc();

                ArrayList arrayList = rf.GetStrArr(pContent, "\"boatid\":", ",");
                for (int i = 0; i < arrayList.Count; i++)
                {
                    string nexurl = "http://t.cjcyw.com:8081/Boat/getBoatById.aspx?userid=" + getuser().token + "&id=" + arrayList[i].ToString() + "";
                    clsPageUrl.AddPageUrl(entity.ProgramName, entity.KeyWord, entity.PID, "cydaDetail", entity.SiteUrl, entity.Url, nexurl,
                                          "GET", "", entity.EnCode, arrayList[i].ToString(), entity.CookieContent, entity.AContent, entity.TrySpiderTimes, entity.Depth + 1);
                }
            }
            catch (Exception ex)
            {
                ClsLog clsLog = new ClsLog();
                clsLog.AddLog(DateTime.Now.ToString(), "分析数据失败" + ex.ToString());
                clsLog.AddLog(DateTime.Now.ToString(), entity.SType + ";" + entity.Url + ";");
                UrlContorl urlContorl = new UrlContorl();
            }
        }
コード例 #13
0
ファイル: MainContorl.cs プロジェクト: harryluo163/Spider
        public void cyPortalAnalysis(PageContentEntity entity)
        {
            try
            {
                string    pContent = entity.PContent;
                Utilities util     = new Utilities();
                SqlBuild  sqlBuild = new SqlBuild();
                SqlPara   sqlPara  = new SqlPara();
                ClsDB     clsDB    = new ClsDB();
                RegFunc   rf       = new RegFunc();

                ArrayList arrayList = rf.GetStrArr(pContent, "\"aid\":", ",");
                for (int i = 0; i < 1; i++)
                {
                    string nexurl = "http://t.cjcyw.com:8081/ship/detail";
                    clsPageUrl.AddPageUrl(entity.ProgramName, entity.KeyWord, entity.PID, "cyDetail", entity.SiteUrl, entity.Url, nexurl,
                                          "POST", "aid=" + arrayList[i].ToString(), entity.EnCode, "aid=" + arrayList[i].ToString(), getuser().cookieContainer, entity.AContent, entity.TrySpiderTimes, entity.Depth + 1);
                }
            }
            catch (Exception ex)
            {
                ClsLog clsLog = new ClsLog();
                clsLog.AddLog(DateTime.Now.ToString(), "分析数据失败" + ex.ToString());
                clsLog.AddLog(DateTime.Now.ToString(), entity.SType + ";" + entity.Url + ";");
            }
        }
コード例 #14
0
        protected void loadData()
        {
            try
            {
                // SHOW THE ENTIRE LIST OF THE FOLDER.
                List <Store> objStoreList        = new List <Store>();
                string       StoreDirectory      = ConfigurationManager.AppSettings["Store_Directory"].ToString();
                string[]     subdirectoryEntries = Directory.GetDirectories(StoreDirectory);
                if (subdirectoryEntries.Length > 0)
                {
                    foreach (var directory in subdirectoryEntries)
                    {
                        DirectoryInfo dirInfo  = new DirectoryInfo(directory);
                        Store         objStore = new Store();
                        objStore.FolderName = dirInfo.Name.ToString();
                        objStore.DateTime   = dirInfo.CreationTime.ToShortDateString();
                        objStore.ImageUrl   = "../Images/android_logo.png";
                        objStoreList.Add(objStore);
                        //foreach (var friend in friendz)
                        //{
                        //    friendsList.Add(
                        //        new Friends { ID = friend.id, Name = friend.name }
                        //    );

                        //}

                        //var data = new List<KeyValuePair<string, string>>()
                        //{
                        //    new KeyValuePair<string, string>( "folder_name",  dirInfo.Name.ToString()),
                        //     new KeyValuePair<string, string>( "date_time",  dirInfo.CreationTime.ToShortDateString())
                        //};

                        // Notice I've created a DirectoryInfo variable.


                        // And likewise a name variable for storing the name.
                        // If this is not added, only the first directory will
                        // be captured in the loop; the rest won't.

                        //string name = dirInfo.Name;


                        //resultList2.Add(data);

                        // Finally we add the directory name to our defined List.
                        //subdirectoryEntries.Add(name);
                    }
                }
                //BIND THE FILE LIST WITH THE REPEATER CONTROL.
                tableData.DataSource = objStoreList;
                tableData.DataBind();
            }
            catch (Exception ex)
            {
                ClsLog.LogException(ex, "Error at Page Home-->loadData");
                Notification("Error at Page Home LoadData", "error");
            }
        }
コード例 #15
0
        protected void LoadStore(string subDomain)
        {
            try
            {
                // SHOW THE ENTIRE LIST OF THE FOLDER.
                string          ApkPath              = "";
                List <GridList> lstGridList          = new List <GridList>();
                string          Details_Directory    = ConfigurationManager.AppSettings["Details_Directory"].ToString();
                string          getDetails_Directory = System.IO.File.ReadAllText(Details_Directory + "details.txt");
                var             details              = JObject.Parse(getDetails_Directory);

                string StoreDirectory = ConfigurationManager.AppSettings["Store_Directory"].ToString();
                StoreDirectory = StoreDirectory + "\\" + subDomain + "\\APP";

                string[] subdirectoryEntries = Directory.GetFiles(StoreDirectory, "*.apk");
                if (subdirectoryEntries.Length > 0)
                {
                    //For file name
                    ApkPath = ConfigurationManager.AppSettings["Store_Directory"].ToString() + "\\" + subDomain + "\\StoreAPK";
                    string[] ApkStoreDirectory = Directory.GetFiles(ApkPath);
                    if (ApkStoreDirectory.Length > 0)
                    {
                        DirectoryInfo dirInfoApk = new DirectoryInfo(ApkStoreDirectory[0]);
                        dwnldlink.Attributes["href"] = "/Raw_Details/Store/" + subDomain + "/StoreAPK/" + dirInfoApk.Name;
                    }
                    foreach (var directory in subdirectoryEntries)
                    {
                        DirectoryInfo dirInfo     = new DirectoryInfo(directory);
                        GridList      objGridList = new GridList();

                        if (System.IO.File.Exists(StoreDirectory + "\\" + dirInfo.Name.Substring(0, dirInfo.Name.Length - 4) + ".txt"))
                        {
                            //getDetails_Directory = System.IO.File.ReadAllText(StoreDirectory + "\\" + dirInfo.Name.Substring(0, dirInfo.Name.Length - 4) + "\\.txt");
                            details             = JObject.Parse(System.IO.File.ReadAllText(StoreDirectory + "\\" + dirInfo.Name.Substring(0, dirInfo.Name.Length - 4) + ".txt"));
                            objGridList.Package = details["package"].ToString().Replace("\"", "").Trim();
                            objGridList.Version = details["version"].ToString().Replace("\"", "").Trim();
                            objGridList.Name    = details["name"].ToString().Replace("\"", "").Trim();
                        }

                        objGridList.ApkName  = dirInfo.Name.ToString();
                        objGridList.DateTime = dirInfo.CreationTime.ToShortDateString();
                        objGridList.ImageUrl = "../Images/android_logo.png";
                        lstGridList.Add(objGridList);
                    }
                }
                //BIND THE FILE LIST WITH THE REPEATER CONTROL.
                tableData.DataSource = lstGridList;
                tableData.DataBind();
            }
            catch (Exception ex)
            {
                ClsLog.LogException(ex, "Error at Page Client Store StoreList-->LoadStore");
                Notification("Error at Page Client Store StoreList", "error");
            }
        }
コード例 #16
0
 protected void lnkLogin_Click(object sender, EventArgs e)
 {
     try
     {
         Response.Redirect("~/Admin/Login.aspx", false);
     }
     catch (Exception ex)
     {
         ClsLog.LogException(ex, "Error at Page Store -->Login_Click");
         Notification("Error at Page Store ", "error");
     }
 }
コード例 #17
0
ファイル: index.cs プロジェクト: harryluo163/spider_winform
        public void spiderMain()
        {
            ClsLog clsLog = new ClsLog();

            clsLog.AddLog(DateTime.Now.ToString(), "入口抓取开始");
            bool       flag            = false;
            int        CurrSpiderTimes = 1;
            ClsPageUrl clsPageUrl      = new ClsPageUrl();

            Control.CheckForIllegalCrossThreadCalls = false;

            clsPageUrl.AddPageUrl("ProgramName", "", "", "Portal", "", "", "http://cht.cjsyw.com:8080/ShipSource/listSS.aspx?pageno=1",
                                  "GET", "", "utf-8", "", null, "", 1, 1);
        }
コード例 #18
0
 protected void OnSendSms(object sender, EventArgs e)
 {
     try
     {
         RepeaterItem item     = (sender as LinkButton).Parent as RepeaterItem;
         string       linkcopy = (item.FindControl("lnkdownload") as HtmlAnchor).HRef.ToString();
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Msg", "onSendSms('" + linkcopy + "');", true);
     }
     catch (Exception ex)
     {
         Notification("Error at OnSendSms", "error");
         ClsLog.LogException(ex, "Error at Page Client Store Home-->OnSendSms");
     }
 }
コード例 #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
         }
     }
     catch (Exception ex)
     {
         ClsLog.LogException(ex, "Error at Page Store -->Page_Load");
         Notification("Error at Page Store ", "error");
     }
 }
コード例 #20
0
ファイル: index.cs プロジェクト: harryluo163/spider_winform
        private void btnStart_Click(object sender, EventArgs e)
        {
            btnStart.Enabled = false;
            #region 日志文件记录
            ClsLog clsLog    = new ClsLog();
            Thread LogThread = new Thread(new ThreadStart(clsLog.WriteLog));
            LogThread.Start();
            #endregion

            #region 抓取线程
            clsLog.AddLog(DateTime.Now.ToString(), "抓取开始");
            ClsPageUrl clsPageUrl   = new ClsPageUrl();
            Thread     SpiderThread = new Thread(new ThreadStart(clsPageUrl.SpiderData));
            SpiderThread.Start();
            #endregion

            #region 分析线程
            ClsPageContent clsPageContent = new ClsPageContent();
            Thread         AnalyseThread  = new Thread(new ThreadStart(clsPageContent.AnalyseData));
            AnalyseThread.Start();
            #endregion

            #region 数据库插入操作线程
            //ClsDB clsDB = new ClsDB();
            //Thread dbThread = new Thread(new ThreadStart(clsDB.ExecPageDBData));
            //dbThread.Start();
            #endregion

            #region 事件注册
            EventController helper = new EventController();
            /// 所有需要分析的,都完成事件
            helper.OnAllItemAnalyzeCompleted += (senders, es) =>
            {
                if (Program.clsUrlSignal == 0 && Program.clsContentSignal == 0 && Program.clsDBSignal == 0)
                {
                    SpiderThread.Abort();
                    AnalyseThread.Abort();
                    //dbThread.Abort();
                    Thread.Sleep(20000);
                    LogThread.Abort();
                    clsLog.AddLog(DateTime.Now.ToString(), "抓取结束");
                }
            };

            #endregion

            //入口方法
            spiderMain();
        }
コード例 #21
0
 protected void OnUpload(object sender, EventArgs e)
 {
     //Find the reference of the Repeater Item.
     try
     {
         RepeaterItem item = (sender as LinkButton).Parent as RepeaterItem;
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Msg", "ShowModal('" + (item.FindControl("lblFolderName") as Label).Text.Trim() + "');", true);
     }
     catch (Exception ex)
     {
         Notification("Error at OnUpload", "error");
         ClsLog.LogException(ex, "Error at Admin Home-->OnUpload");
     }
     //this.ToggleElements(item, true);
 }
コード例 #22
0
        public void HousePortalAnalysis(PageContentEntity entity)
        {
            try
            {
                string     pContent   = entity.PContent;
                ClsPageUrl clsPageUrl = new ClsPageUrl();
                Utilities  util       = new Utilities();
                SqlBuild   sqlBuild   = new SqlBuild();
                SqlPara    sqlPara    = new SqlPara();
                ClsDB      clsDB      = new ClsDB();
                RegFunc    rf         = new RegFunc();


                ArrayList arrayList = rf.GetStrArr(pContent, "\"id\":", ",");
                for (int k = 0; k < arrayList.Count; k++)
                {
                }



                string   KeyWord = entity.KeyWord;
                decimal  num;
                DateTime dt;
                string   postDataStr = "";
                pContent = rf.GetStr(pContent, "/共有", "页");
                if (pContent != "")
                {
                    for (int i = 1; i <= Convert.ToInt32(pContent); i++)
                    //for (int i = 1; i <= 1; i++)
                    {
                        //       clsPageUrl.AddPageUrl(entity.ProgramName, entity.KeyWord, entity.PID, "Batch", entity.SiteUrl, entity.Url, "http://218.14.207.76/xxgs/xmlpzs/webissue.asp?page=" + i,
                        //"GET", "", entity.EnCode, i.ToString(), entity.CookieContent, entity.AContent, entity.TrySpiderTimes, entity.Depth + 1);
                    }
                }
                else
                {
                    throw new Exception("分析数据失败:页面没有数据");
                }
            }
            catch (Exception ex)
            {
                ClsLog clsLog = new ClsLog();
                clsLog.AddLog(DateTime.Now.ToString(), "分析数据失败" + ex.ToString());
                clsLog.AddLog(DateTime.Now.ToString(), entity.SType + ";" + entity.Url + ";");
                UrlContorl urlContorl = new UrlContorl();
                urlContorl.SaveUrl(entity, ex.ToString());
            }
        }
コード例 #23
0
 protected void OnShare(object sender, EventArgs e)
 {
     try
     {
         RepeaterItem item     = (sender as LinkButton).Parent as RepeaterItem;
         string       linkcopy = (item.FindControl("lnkdownload") as HtmlAnchor).HRef.ToString();
         string       name     = (item.FindControl("lblName") as Label).Text.Trim();
         string       version  = (item.FindControl("lblAPKVersion") as Label).Text.Trim();
         version = version.Replace("Version:", "");
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Msg", "onShare('" + name + "','" + linkcopy + "','" + version + "','" + Session["SubDomain"].ToString().ToUpper() + "');", true);
     }
     catch (Exception ex)
     {
         Notification("Error at OnShare", "error");
         ClsLog.LogException(ex, "Error at Page Client Store Home-->OnShare");
     }
 }
コード例 #24
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtsearch.Text == "")
         {
             Notification("Enter store name to Search", "error");
             return;
         }
         Session["SearchValue"] = txtsearch.Text.ToString().Trim();
         Response.Redirect("~/Store/Home.aspx");
     }
     catch (Exception ex)
     {
         ClsLog.LogException(ex, "Error at Page Store -->Search_Click");
         Notification("Error at Page Store Search ", "error");
     }
 }
コード例 #25
0
 protected void btnEditSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         string ApkPath = "";
         ApkPath = ConfigurationManager.AppSettings["Store_Directory"].ToString() + "\\" + Session["SubDomain"] + "\\APP\\" + hiddenEditApkName.Value.Substring(0, hiddenEditApkName.Value.Length - 4).ToString() + ".txt";
         System.IO.File.Delete(ApkPath);
         StreamWriter sw = new StreamWriter(ApkPath, true);
         sw.Write("{\"name\":\"" + txtEditName.Text.ToString().Trim() + "\",\"package\":\"" + txtEditPackage.Text.ToString().Trim() + "\",\"version\":\"" + txtEditVersion.Text.ToString().Trim() + "\"}");
         sw.Close();
         LoadStore(Session["SubDomain"].ToString());
         Notification("Updated Successfully", "success");
     }
     catch (Exception ex)
     {
         Notification("Error at btnEditSubmit_Click", "error");
         ClsLog.LogException(ex, "Error at Client Store Home-->btnEditSubmit_Click");
     }
 }
コード例 #26
0
        protected void tableData_ItemCreated(Object Sender, RepeaterItemEventArgs e)
        {
            try
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    ScriptManager scriptMan = ScriptManager.GetCurrent(this);
                    LinkButton    btn       = e.Item.FindControl("lnkUpload") as LinkButton;
                    if (btn != null)
                    {
                        btn.Click += OnUpload;
                        scriptMan.RegisterAsyncPostBackControl(btn);
                    }

                    btn = e.Item.FindControl("lnkEdit") as LinkButton;
                    if (btn != null)
                    {
                        btn.Click += OnEdit;
                        scriptMan.RegisterAsyncPostBackControl(btn);
                    }

                    btn = e.Item.FindControl("lnkDeleteAPK") as LinkButton;
                    if (btn != null)
                    {
                        btn.Click += OnDeleteAPK;
                        scriptMan.RegisterAsyncPostBackControl(btn);
                    }

                    btn = e.Item.FindControl("lnkDelete") as LinkButton;
                    if (btn != null)
                    {
                        btn.Click += OnDelete;
                        scriptMan.RegisterAsyncPostBackControl(btn);
                    }
                }
            }
            catch (Exception ex)
            {
                Notification("Error at  Admin Home OnItemCreated", "error");
                ClsLog.LogException(ex, "Error at Page Admin Home-->OnItemCreated");
            }
        }
コード例 #27
0
        protected void OnDelete(object sender, EventArgs e)
        {
            try
            {
                RepeaterItem item          = (sender as LinkButton).Parent as RepeaterItem;
                string       lblFolderName = (item.FindControl("lblFolderName") as Label).Text.Trim();

                string StoreDirectory = ConfigurationManager.AppSettings["Store_Directory"].ToString();
                StoreDirectory = StoreDirectory + "\\" + lblFolderName;

                Directory.Delete(StoreDirectory, true);
                loadData();
                Notification("Deleted Successfully", "success");
            }
            catch (Exception ex)
            {
                Notification("Error at OnDelete", "danger");
                ClsLog.LogException(ex, "Error at Page Admin Home-->OnDelete");
            }
        }
コード例 #28
0
        protected void lnkShareMain_Click(object sender, EventArgs e)
        {
            try
            {
                string ApkPath  = "";
                string linkcopy = "";
                string name     = "";
                string version  = "";

                string Details_Directory    = ConfigurationManager.AppSettings["Details_Directory"].ToString();
                string getDetails_Directory = System.IO.File.ReadAllText(Details_Directory + "details.txt");
                var    details = JObject.Parse(getDetails_Directory);

                string domain = details["domain"].ToString().Replace("\"", "").Trim();
                domain = domain.Substring(1, domain.Length - 1);

                ApkPath = Details_Directory;

                string[] subdirectoryEntries = Directory.GetFiles(ApkPath, "*.apk");
                if (subdirectoryEntries.Length > 0)
                {
                    DirectoryInfo dirInfoApk = new DirectoryInfo(subdirectoryEntries[0]);
                    linkcopy = "http://" + domain + "/Raw_Details/" + dirInfoApk.Name;
                    if (System.IO.File.Exists(ApkPath + dirInfoApk.Name.Substring(0, dirInfoApk.Name.Length - 4) + ".txt"))
                    {
                        //getDetails_Directory = System.IO.File.ReadAllText(StoreDirectory + "\\" + dirInfo.Name.Substring(0, dirInfo.Name.Length - 4) + "\\.txt");
                        details = JObject.Parse(System.IO.File.ReadAllText(ApkPath + "\\" + dirInfoApk.Name.Substring(0, dirInfoApk.Name.Length - 4) + ".txt"));
                        version = details["version"].ToString().Replace("\"", "").Trim();
                        name    = details["name"].ToString().Replace("\"", "").Trim();
                    }
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Msg", "onShare('" + name + "','" + linkcopy + "','" + version + "','myAppStore');", true);
                }
            }
            catch (Exception ex)
            {
                Notification("Error at OnShareMain", "error");
                ClsLog.LogException(ex, "Error at Page Store Home-->OnShareMain");
            }
        }
コード例 #29
0
 protected void btnUpload_Click(object sender, EventArgs e)
 {
     try
     {
         //Check for password file of store
         string filePath = "";
         filePath = ConfigurationManager.AppSettings["Store_Directory"].ToString();
         if (System.IO.File.Exists(filePath + "\\" + Session["SubDomain"].ToString() + "\\password.txt"))
         {
             if (Session["StoreUserName"] == null)
             {
                 Notification("Login to Upload APP.", "error");
                 return;
             }
         }
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Msg", "ShowPanelAdd();", true);
     }
     catch (Exception ex)
     {
         Notification("Error at OnUpload", "error");
         ClsLog.LogException(ex, "Error at Page Client Store Home-->btnUpload");
     }
 }
コード例 #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             //if (Session["SubDomain"] == null)
             if (Session["StoreUserName"] == null)
             {
                 Response.Redirect("~/ClientStore/Home.aspx");
             }
             else
             {
                 LoadStore(Session["SubDomain"].ToString());
             }
         }
     }
     catch (Exception ex)
     {
         ClsLog.LogException(ex, "Error at Page Client Store StoreList-->OnLoad");
         Notification("Error at Page Client Store StoreList OnLoad", "error");
     }
 }