Click here to Skip to main content
15,906,329 members
Home / Discussions / C#
   

C#

 
Questiona program for documentation. Pin
Green Fuze26-Aug-06 2:03
Green Fuze26-Aug-06 2:03 
AnswerRe: a program for documentation. Pin
Nader Elshehabi26-Aug-06 2:09
Nader Elshehabi26-Aug-06 2:09 
GeneralRe: a program for documentation. Pin
Colin Angus Mackay26-Aug-06 2:17
Colin Angus Mackay26-Aug-06 2:17 
GeneralRe: a program for documentation. Pin
Green Fuze26-Aug-06 2:18
Green Fuze26-Aug-06 2:18 
AnswerRe: a program for documentation. Pin
Colin Angus Mackay26-Aug-06 2:16
Colin Angus Mackay26-Aug-06 2:16 
GeneralRe: a program for documentation. Pin
Green Fuze26-Aug-06 2:21
Green Fuze26-Aug-06 2:21 
GeneralRe: a program for documentation. Pin
Ed.Poore26-Aug-06 3:26
Ed.Poore26-Aug-06 3:26 
QuestionHow can i open network printer as file in C#? Pin
empika26-Aug-06 1:44
empika26-Aug-06 1:44 
Hi
Does anyone know how do i can open a network printer as a file in C#?
I am using a xerox printer and would like to be able to send 'VIPP' comands
to it easily once i have written a reusable class that will facilitate this.

I can open the printer and write a line to it in vb6 just like this:

Open FindPrinter("\\ip123\thePrinter") For Output As #1
Print #1, "%%XGF example print command" //this would be a special print command
Close #1

the equivalent in C# as far as i can see does not seem to work:

IO.StreamWriter swMyPrinter;
swMyPrinter = new IO.StreamWriter("\\\\ip123\\thePrinter");
swMyPrinter.WriteLine("Hallo\n");
swMyPrinter.Close();

this returns an error telling me i need to call 'CreateFile' myself and then
use 'FileStream' contructors if i want to open devices like this. I think
this type of thing may only allow me to open a local printer on LPT1 as it does
not seem to be able to open the handle to the printer.

Is there a simple way of opening a network printer for writing?

Thanks in advance
Edd


AnswerRe: How can i open network printer as file in C#? Pin
Nader Elshehabi26-Aug-06 2:03
Nader Elshehabi26-Aug-06 2:03 
GeneralRe: How can i open network printer as file in C#? Pin
empika26-Aug-06 2:13
empika26-Aug-06 2:13 
GeneralRe: How can i open network printer as file in C#? Pin
tigerButterfly26-Aug-06 8:49
tigerButterfly26-Aug-06 8:49 
GeneralRe: How can i open network printer as file in C#? Pin
empika30-Aug-06 22:49
empika30-Aug-06 22:49 
GeneralRe: How can i open network printer as file in C#? Pin
tigerButterfly31-Aug-06 4:51
tigerButterfly31-Aug-06 4:51 
Questionmscoree.dll error Pin
Timothy_Rudolph26-Aug-06 1:36
Timothy_Rudolph26-Aug-06 1:36 
AnswerRe: mscoree.dll error Pin
Nader Elshehabi26-Aug-06 1:47
Nader Elshehabi26-Aug-06 1:47 
QuestionSelect an area in photoshop from a C# project Pin
Bauke Tilma26-Aug-06 0:29
Bauke Tilma26-Aug-06 0:29 
QuestionRe: Select an area in photoshop from a C# project Pin
Nader Elshehabi26-Aug-06 2:21
Nader Elshehabi26-Aug-06 2:21 
QuestionDataGrid Pin
MozhdehQeraati26-Aug-06 0:29
MozhdehQeraati26-Aug-06 0:29 
AnswerRe: DataGrid Pin
Nader Elshehabi26-Aug-06 2:31
Nader Elshehabi26-Aug-06 2:31 
QuestionResulation Pin
MHASSANF25-Aug-06 23:26
MHASSANF25-Aug-06 23:26 
AnswerRe: Resulation Pin
Nader Elshehabi26-Aug-06 2:50
Nader Elshehabi26-Aug-06 2:50 
QuestionHow can I show each page sum colon in Crystal Reports? Pin
ersinsivaz25-Aug-06 23:12
ersinsivaz25-Aug-06 23:12 
QuestionClosing a form - Tooltips Pin
Glen Harvy25-Aug-06 22:54
Glen Harvy25-Aug-06 22:54 
AnswerRe: Closing a form - Tooltips Pin
Filip van der Meeren25-Aug-06 23:14
Filip van der Meeren25-Aug-06 23:14 
GeneralRe: Closing a form - Tooltips Pin
Glen Harvy25-Aug-06 23:29
Glen Harvy25-Aug-06 23:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.