DOT.NET Thraed תחת משתמש אחר
-
דוגמא:
using (SimpleImpersonation.Impersonation.LogonUser("", "userName", "password", SimpleImpersonation.LogonType.Interactive)) { PrintDocument pd = new PrintDocument(); pd.PrinterSettings.PrinterName = printerName; pd.PrintPage += PrintPage; pd.Print(); } private void PrintPage(object o, PrintPageEventArgs e) { e.Graphics.DrawImage(new Bitmap(fileName), new Rectangle(0, 0, e.PageSettings.PaperSize.Width, e.PageSettings.PaperSize.Height)); }
פורסם במקור בפורום CODE613 ב06/11/2017 22:21 (+02:00)