diff --git a/Form1.cs b/Form1.cs index 08a263c..994235b 100644 --- a/Form1.cs +++ b/Form1.cs @@ -125,8 +125,12 @@ void GetInformation() html.LoadHtml(s); if (!String.IsNullOrEmpty(cookie)) { - var avatar = html.DocumentNode.SelectSingleNode("//div[contains(@class, 'acw')]").SelectSingleNode("//img[contains(@alt, 'profile picture')]").Attributes["src"].Value.Replace("&", "&"); - pictureBox1.Load(avatar); + if (String.IsNullOrEmpty(Config.Read("CustomImagePath", "Config"))) + { + var avatar = html.DocumentNode.SelectSingleNode("//div[contains(@class, 'acw')]").SelectSingleNode("//img[contains(@alt, 'profile picture')]").Attributes["src"].Value.Replace("&", "&"); + pictureBox1.Load(avatar); + } + else pictureBox1.Load(Config.Read("CustomImagePath", "Config")); var name = html.DocumentNode.SelectSingleNode("//span/div/span/strong").InnerText; if (name.Contains("(")) name = name.Substring(0, name.IndexOf('(') - 1); if (name.IndexOf('(') - 1 > 0) label1.Text = name.Substring(0, name.IndexOf('(') - 1); @@ -162,8 +166,12 @@ void GetInformation() } else { - var avatar = html.DocumentNode.SelectSingleNode("//img[contains(@alt, 'profile')]").Attributes["src"].Value.Replace("&", "&"); - pictureBox1.Load(avatar); + if (String.IsNullOrEmpty(Config.Read("CustomImagePath", "Config"))) + { + var avatar = html.DocumentNode.SelectSingleNode("//img[contains(@alt, 'profile')]").Attributes["src"].Value.Replace("&", "&"); + pictureBox1.Load(avatar); + } + else pictureBox1.Load(Config.Read("CustomImagePath", "Config")); var name = html.DocumentNode.SelectSingleNode("//div[@id='cover-name-root']").InnerText; label1.Text = name; label2.Text = "Active status unavailable"; diff --git a/README.md b/README.md index d3a4b8f..e69b01f 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ AdditionalStyle= | `AdditionalStyle` | `string` | The additional style of the texts. Supported additional styles are `Bold` or `Italic`. | | `CustomName` | `string` | The custom name to be displayed instead of the actual Facebook name. | | `CustomClickLink` | `string` | The custom link to be opened when clicking the widget, with `$id` as the user's Facebook ID. | +| `CustomImagePath` | `string` | The custom image path of the widget (can be *an URL* or *a path to the image on your computer*). | If you don't want to configure this application yourself, there are some presets on the `Presets` folder of the pre-built application. Just copy one of them to the executable folder, rename it to `Config.ini` and edit the ID and cookie of that file.