Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: please help me in C# Pin
martin_hughes24-Sep-07 1:29
martin_hughes24-Sep-07 1:29 
Questionhow to make HTML Page Pin
Jintal Patel23-Sep-07 20:37
Jintal Patel23-Sep-07 20:37 
AnswerRe: how to make HTML Page Pin
Christian Graus23-Sep-07 21:06
protectorChristian Graus23-Sep-07 21:06 
GeneralRe: how to make HTML Page Pin
Jintal Patel23-Sep-07 21:27
Jintal Patel23-Sep-07 21:27 
GeneralRe: how to make HTML Page Pin
Malcolm Smart23-Sep-07 21:32
Malcolm Smart23-Sep-07 21:32 
GeneralRe: how to make HTML Page Pin
Jintal Patel23-Sep-07 21:57
Jintal Patel23-Sep-07 21:57 
GeneralRe: how to make HTML Page Pin
Malcolm Smart23-Sep-07 22:06
Malcolm Smart23-Sep-07 22:06 
Questionsend byte array to a printer and reading back through a serial port Pin
bttds23-Sep-07 20:36
bttds23-Sep-07 20:36 
I need to print encrypted customer details as a barcode. then need to scan the data and read back the details.
My approch is like this,
I encrypted the string data using cryptoservices and get memory stream and sen the byte array data as unmanaged byte arra to the printer.

Byte[] bytes = memoryStream.GetBuffer();
IntPtr pUnmanagedBytes = new IntPtr(0);
int nLength;

nLength = Convert.ToInt32(memoryStream.Length);
pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength);
Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength);

PrintDirect.WritePrinter1(lhPrinter, pUnmanagedBytes, nLength, out pcWritten);


When I try to read the barcode through a serial port my byte array size is smaller

int bytes = comport.BytesToRead;
byte[] buffer = new byte[bytes];
comport.Read(buffer, 0, bytes);

I've send 184 bytes to the printer. but now my buffer size is 181
can anybody help me

AnswerRe: send byte array to a printer and reading back through a serial port Pin
Christian Graus23-Sep-07 21:04
protectorChristian Graus23-Sep-07 21:04 
GeneralOT Pin
Pete O'Hanlon23-Sep-07 21:47
mvePete O'Hanlon23-Sep-07 21:47 
GeneralRe: send byte array to a printer and reading back through a serial port Pin
bttds23-Sep-07 22:22
bttds23-Sep-07 22:22 
AnswerRe: send byte array to a printer and reading back through a serial port Pin
Guffa23-Sep-07 22:50
Guffa23-Sep-07 22:50 
GeneralRe: send byte array to a printer and reading back through a serial port Pin
bttds23-Sep-07 23:34
bttds23-Sep-07 23:34 
QuestionPrinting a file using process object Pin
gauthee23-Sep-07 20:04
gauthee23-Sep-07 20:04 
AnswerRe: Printing a file using process object Pin
blackjack215024-Sep-07 0:23
blackjack215024-Sep-07 0:23 
QuestionCompare 2 datasets Pin
Anu SE23-Sep-07 19:57
Anu SE23-Sep-07 19:57 
AnswerRe: Compare 2 datasets Pin
gauthee23-Sep-07 20:19
gauthee23-Sep-07 20:19 
AnswerRe: Compare 2 datasets Pin
Jintal Patel23-Sep-07 20:50
Jintal Patel23-Sep-07 20:50 
GeneralRe: Compare 2 datasets Pin
Anu SE23-Sep-07 21:00
Anu SE23-Sep-07 21:00 
GeneralRe: Compare 2 datasets Pin
Jintal Patel23-Sep-07 21:17
Jintal Patel23-Sep-07 21:17 
GeneralRe: Compare 2 datasets Pin
Anu SE23-Sep-07 21:22
Anu SE23-Sep-07 21:22 
GeneralRe: Compare 2 datasets Pin
Jintal Patel24-Sep-07 0:59
Jintal Patel24-Sep-07 0:59 
AnswerRe: Compare 2 datasets Pin
Lutosław24-Sep-07 0:51
Lutosław24-Sep-07 0:51 
QuestionVirtual Function and "New" modifier Pin
.NET- India 23-Sep-07 19:44
.NET- India 23-Sep-07 19:44 
AnswerRe: Virtual Function and "New" modifier Pin
Nitin S23-Sep-07 20:18
professionalNitin S23-Sep-07 20:18 

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.