DeanJansen
New member
- Joined
- Dec 19, 2016
- Messages
- 1
- Programming Experience
- 3-5
Good Day Everyone,
Im busy making this small application for work to test a few things
I have the following code runs when a button is pressed
It works as planned.
All i want to do now is to be able change the Owner from "Dean" to any user i need.
Or if there is any better way to send print jobs to a print server from any username.
Thank You
Ref : Change Print Job Owner in Print Queue
Im busy making this small application for work to test a few things
I have the following code runs when a button is pressed
C#:
// Create the printer server and print queue objectsLocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueue defaultPrintQueue = LocalPrintServer.GetDefaultPrintQueue();
// Call AddJob
PrintSystemJobInfo myPrintJob = defaultPrintQueue.AddJob("My Test Job");
// Write a Byte buffer to the JobStream and close the stream
Stream myStream = myPrintJob.JobStream;
Byte[] myByteBuffer = UnicodeEncoding.Unicode.GetBytes("Test Print Job");
myStream.Write(myByteBuffer, 0, myByteBuffer.Length);
myStream.Close();
It works as planned.
All i want to do now is to be able change the Owner from "Dean" to any user i need.
Or if there is any better way to send print jobs to a print server from any username.
Thank You
Ref : Change Print Job Owner in Print Queue
Last edited by a moderator: