473,795 Members | 2,512 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

printing thru TCPIP

Ji,
i tried to use tcpclient to send a series of PCL command to a printer, but
after going thru this, it print out a series of junk...the same series work
well with another code i written for parallel...pls advise??

Public Function PrintChunkTCPIP (ByVal Chunk As String) As Long
Dim x As Integer
Dim client As New System.Net.Sock ets.TcpClient(" 169.254.192.155 ",
9100)

' Get a client stream for reading and writing.
' Stream stream = client.GetStrea m();
Dim stream As System.Net.sock ets.NetworkStre am = client.GetStrea m()
Dim data As [Byte]() = System.Text.Enc oding.ASCII.Get Bytes(Chunk)

' Send the message to the connected TcpServer.
stream.Write(da ta, 0, data.Length)
data = New [Byte](256) {}

' String to store the response ASCII representation.
Dim responseData As [String] = [String].Empty

' Read the first batch of the TcpServer response bytes.
Dim bytes As Int32 = stream.Read(dat a, 0, data.Length)
responseData = System.Text.Enc oding.ASCII.Get String(data, 0, bytes)
Me.Text = "Received: {0}" + responseData

' Close everything.
client.Close()
End Function
Nov 21 '05 #1
0 925

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2578
by: Bob Harrison | last post by:
I will be distributing an application that works with our security panel. The application can be loaded on several workstations in a network but only one workstation actually communicates via serial port or tcpip with the security panel. I modified the client chat sample that you have in your .net tcpip samples so that I can send info back and forth between the main (polling) workstation and any other workstations. The info is not keyed...
1
5414
by: Meenakshi | last post by:
Hello everyone Can anybody help me out. i want to print two pages per single sheet. a book like printing. that is first page as well as last page of the document print on same side of the single sheet. how can i do this thru C# language Thanks Regards Meenakshi
1
2727
by: tony zheng via DBMonster.com | last post by:
Hi,any one know ,in DRDA enviroment DB27.1 running in ZOS/E,I find when apllication program access DB2 through DB2connect ,in mainframe two address space TCPIP and DIST CPU usage were very high ,and DBM1 or MSTR address are low,one sample maybe 15%(tcpip),10%(DIST),1%(DBM1),we are 100% DRDA envirnoment,I don't know is it normally? Do anyone has experience on this area?Hope can help me,thanks -- Message posted via http://www.dbmonster.com
4
5874
by: Jamey Shuemaker | last post by:
I've been looking for a way to do a duplex print job without a duplex printer. I reviewed some old posts about printing odd pages and found that most of them led to KB article 101075 or an export of the document to Word for duplexing there. I was looking for a VBA method for doing this, so the KB article is right out and when you export to Word, some of the report's text boxes wind up truncated because of some sort of sizing difficulty...
0
2354
by: Stuart Norris | last post by:
Dear Group, I am having a problem setting SocketOptionName.SendTimeout on a client TCPIP application using the sockets in .NET. From the on-line help it is possible to set a SocketOptionName.SendTimeout for sends on TCPIP sockets. In all the tests that I have done with both Async and Sync sends the send returns immediately with the number of bytes sent (< 100 in my messages).
0
1503
by: Karthik | last post by:
Well I am coding an application using C# for my company which requires multiple printing of Crystal Report Docs & Word Docs, at a specific Printer of the installed Printers in the network, at a specific tray and some more settings too. since I'm trying with the network printer I've installed a local driver using the local port as suggested by one of the MS support site. The definition of the Printer & Tray is happening from the code...
4
2769
by: Carl Tribble | last post by:
Is there a method in VB .NET to convert a numeric dollar amount to it's text equivalent for printing on a check? Thanks, -Carl
1
382
by: zoneal | last post by:
Part of our peer review process is a code walk-thru using hard-copy source code. I'm not real happy with the way source code is printed in VS.Net. In VB6 we had the option of printing the entire project, just the module, etc. In VB.Net that control appears to be missing-what's open is what you get. Further, I've already wasted a ream of paper by forgetting to expand all the regions before printing. Do you have any suggestions? Thanks.
3
4202
by: TulasiKumar | last post by:
hi all, My requirment is i want to listen one perticular TCPIP port for one IPAddress,Wheneverver the data in coming to this port that data i will be save one text file..For example:www.msdn.microsoft.com is fixed with some TCPIP port.Whene ever data is coming in to the TCPIP that data i will be saved one text file.I have done the code regrading my requirement.Whenever i have started my listner class it was giving one exception ,the...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.