To get the default printer name in C# and VB.NET you can use the following snippet.

Samples

Sample C#

public string GetDefaultPrinter()
{
	PrinterSettings settings = new PrinterSettings();
	return settings.PrinterName;
}

Sample VB.NET

Public Function GetDefaultPrinter() As String
	Dim settings as PrinterSettings = New PrinterSettings()
	Return settings.PrinterName
End Function

Compatibility: working .NET 2.0 working .NET 3.0 not tested .NET 3.5 not working .NET 4.0 not working .NET 4.5not working .NET 4.6

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

5 thought on “How to get the default printer name in C# and VB.NET”

Leave a Reply