-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelpForm.cs
44 lines (41 loc) · 1.4 KB
/
HelpForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Amazon.Runtime.Documents;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutomatedAWSModelCreator
{
public partial class HelpForm : Form
{
public HelpForm()
{
InitializeComponent();
helpBox.LinkClicked += HelpBox_LinkClicked;
string readmeUrl = "https://raw.githubusercontent.com/kerrlabajo/Automated-AWS-Model-Creator/main/README.md";
using (HttpClient client = new HttpClient())
{
try
{
string readmeText = "You may refer to https://github.com/kerrlabajo/Automated-AWS-Model-Creator/blob/main/README.md.\n" + client.GetStringAsync(readmeUrl).Result;
helpBox.Text = readmeText;
}
catch (Exception ex)
{
MessageBox.Show("Error fetching README.md file: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void HelpBox_LinkClicked(object sender, LinkClickedEventArgs e)
{
// Open the link in the default browser
System.Diagnostics.Process.Start(e.LinkText);
}
}
}