これは、通常 aspx Web フォームを実行し、出力から文字列を取得する方法です。
public static string GetAspPageOutput(string page)
{
string html;
using (var sw = new StringWriter())
{
HttpContext.Current.Server.Execute(page, sw);
html = sw.ToString();
}
return html;
}
代わりにバイト配列を取得するにはどうすればよいですか?