/// <summary> /// 讀取html裡面的body內容(不包括<body>標簽) /// </summary> /// <param name="htmlUrl">要讀取的html地址</param> private string ReadHtmlToEditHtml(string htmlUrl) { string htmlContent1 = string.Empty; using (StreamReader reader = new StreamReader(htmlUrl)) { htmlContent1 += reader.ReadToEnd(); } Regex reg = new Regex("(?is)<body[^>]*>(?<body>.*?)</body>"); string bodyHtml = ""; bodyHtml = reg.Match(htmlContent1).Groups["body"].Value; return bodyHtml; }