Exemple #1
0
        /// <summary>
        /// Check if given path exists
        /// </summary>
        /// <returns></returns>
        private bool CheckPath()
        {
            if (!ISharedMethods.IsObjectEmptyOrNull(this.filePath))
            {
                if (System.IO.File.Exists(this.filePath))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
 private void GetInfo()
 {
     try
     {
         string str = new WebClient {
             Encoding = Encoding.UTF8
         }.DownloadString(this.GameUrl);
         if (!ISharedMethods.IsObjectEmptyOrNull(str))
         {
             Match match  = Regex.Match(str, "<div id=\\\"overview1.*?<div id=\\\"overview2", RegexOptions.Singleline);
             Match match2 = Regex.Match(match.Value, "<p>.+?</p>", RegexOptions.Singleline);
             Match match3 = Regex.Match(match.Value, "<img alt=\\\".+?\\\"", RegexOptions.Singleline);
             this.gameDescription = HttpUtility.HtmlDecode(match2.Value.Replace("<p>", "").Replace("</p>", ""));
             this.gameName        = HttpUtility.HtmlDecode(match3.Value.Remove(match3.Value.Length - 1).Replace("<img alt=\"", ""));
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #3
0
        private void GetInfo()
        {
            try
            {
                System.Net.WebClient client = new System.Net.WebClient();
                client.Encoding = Encoding.UTF8;

                string source = client.DownloadString(GameUrl);

                if (!ISharedMethods.IsObjectEmptyOrNull(source))
                {
                    Match overview1Match   = Regex.Match(source, "<div id=\\\"overview1.*?<div id=\\\"overview2", RegexOptions.Singleline);
                    Match descriptionMatch = Regex.Match(overview1Match.Value, "<p>.+?</p>", RegexOptions.Singleline);
                    Match gameNameMatch    = Regex.Match(overview1Match.Value, "<img alt=\\\".+?\\\"", RegexOptions.Singleline);

                    gameDescription = HttpUtility.HtmlDecode(descriptionMatch.Value.Replace("<p>", "").Replace("</p>", ""));
                    gameName        = HttpUtility.HtmlDecode(gameNameMatch.Value.Remove(gameNameMatch.Value.Length - 1).Replace("<img alt=\"", ""));
                }
            }
            catch (Exception ex)
            {
                //throw new Exception("Error downloading game description for Title id: " + this.title_id, ex);
            }
        }
Exemple #4
0
 private bool CheckPath()
 {
     return(!ISharedMethods.IsObjectEmptyOrNull(this.filePath) && System.IO.File.Exists(this.filePath));
 }