需求 Requirements 網頁瀏覽的物件:填寫表單之類的 執行外部程式:註冊完成後執行KKBOX 方案 Solutions Object: WebBrowser (Document) WebBrowser.Document (HtmlElementCollection) WebBrowser.Document.All (HtmlElement).GetAttribute (HtmlElement).SetAttribute Class: Microsoft.Win32 .Registry & .RegistryKey Class: Process 範例 Examples // 瀏覽網頁 wb1.Navigate(@"https://ssl.kkbox.com.tw/reg_step1.php"); // 操作網頁元素 // 1 取得網頁物件 HtmlDocument hd = wb1.Document; // 2 取得單一網頁元素 HtmlElement he = hd.All[0]; // HtmlElement he = hd.GetElementById("uid"); // 3 設定網頁元素的屬性 he.SetAttribute("name", "xxxx"); he.SetAttribute("checked", "false"); // for checkbox he.InnerText = "yyyy"; // 4 取得網頁元素的屬性 string name = he.GetAttribute("name"); // return "xxxx" // 5 執行網頁元素的事件 he.InvokeMember("click"); // 更新網頁 wb1.Refresh(); // 取得註冊表的值 string reg_key = "HKEY_CURRENT_USER\\Software\\Skysoft\\kkbox"; strin...