2
string s="<html><body>..some html code..</body></html>";
如何在沒有PrintDialog
的情況下打印文檔?C#html html中打印html文件的字符串
輸出:...一些HTML代碼...
string s="<html><body>..some html code..</body></html>";
如何在沒有PrintDialog
的情況下打印文檔?C#html html中打印html文件的字符串
輸出:...一些HTML代碼...
正如我理解正確的話,你需要WebBrowser類:
WebBrowser webBrowser = new WebBrowser();
void Print(string str)
{
webBrowser.DocumentText = str;
webBrowser.DocumentCompleted += webBrowser_DocumentCompleted;
}
void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser.Print();
}
[HTML/JavaScript的一個鍵打印的
謝謝.Sposibo bolwe –
可能重複(無對話框)](http://stackoverflow.com/questions/9213660/html-javascript-one-click-print-no-dialogs) – Shaharyar
ASP.NET?的WinForms? WPF? –
不清楚你在問什麼,打印是什麼意思? – Jodrell