How do you add a printer to a w2k server using C#

  • Thread starter Thread starter ken
  • Start date Start date
K

ken

Hello Everyone,

I am trying to find out how to add a printer to a windows 2000 advance
server by using C# code.
I cannot believe how bad the MSDN subscription is when it comes to searching
for .NET framework objects!! There seems to be a big supply of objects to
get all the settings after the printer has been installed, but I cannot find
any info on how to add a printer to a server . Does anyone have an idea of
what objects to use? Any help will be appreciated.

Thank You in Advance for Your Help,
Ken
 
Hello Kenneth,

I noticed that the similar issue was posted in several groups (places)....I
have added a reply to you at your post:
"Does .Netframework have a way to add a network printer"
If you have follow up questions, please post there and I will work with
you. Thanks.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Kenneth Koski <[email protected]>
| References: <[email protected]>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: Re: How do you add a printer to a w2k server using C#
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Date: Thu, 31 Jul 2003 12:25:48 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:173365
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hello Jim,
|
| I could not find "System.Win32" are you referring to System.Windows? I
| am using "System.Runtime.Interopservices" for most of the printer
| pieces, but I can not find the correct syntax for importing the
| AddPrinter dll.
| This is what I have , which works, for openprinter. Does anyone know
| what it would be for AddPrinter?
|
| [DllImport("winspool.Drv", EntryPoint="GetPrinterA", SetLastError=true,
| CharSet=CharSet.Ansi,ExactSpelling=true,
| CallingConvention=CallingConvention.StdCall)]
| private static extern bool GetPrinter(IntPtr hPrinter, Int32 dwLevel,
| IntPtr pPrinter, Int32 dwBuf, out Int32 dwNeeded);
|
| Thank You in Advance for Your Help,
| Ken
|
|
|
|
|
|
|
|
|
| Don't just participate in USENET...get rewarded for it!
|
 
Back
Top