|
|
|
Hi,
I'm trying to find out if this is possible, and if so how to do it. From a machine running XP or Vista, as I understand it, when you send something to print, Windows/the print drivers render the file into a format the printer can read and understand (a spool file?). This file is sent to the printer then the local copy is deleted. I believe this file is held briefly in the 'C:\WINDOWS\system32\spool\PRINTERS' folder, which is effectively the shared print queue folder. for all printers on that machine.
My question is whether you can capture this 'raw' spooler data (I've managed to copy and paste to capture the files that appear in the spool folder, but you have to be fast!), and crucially, once you've captured it, can you then somehow send it to print again?
I have a feeling this is more complicated than I think. Presumably there are different formats of spooler data etc? Is there a utility that can do the printing/viewing of captured files?
|
|
|
|
|
You could write something to monitor that directory and capture files that were created. I'm not sure if your copy of those files would cause problems in the printing process if the file is in use (the program copying it) when it is attempting to be deleted.
There are ways to send the raw files right back to the printer to print again. But you need to realize that each printer has its own language. The Windows printer drivers take the documents and convert them to the language of the printer. So I'm not sure you could create something generic for all printers...
How to send raw data to a printer by using C#.[^]
Hogan
|
|
|
|
|
say i was only given port numbers of all running servers in a particular LAN network.
Any hint on how to obtained the corresponding ip addresses for these ports?
Thanks in advance
|
|
|
|
|
Get the Ipaddreses of your lan first u can use command "net view" it gives the machine names of all your network , then get the corresponding ipaddress of each machine, then combine ipaddress combination with your port list and ping, if u got answer then u have the correct ipaddress.
|
|
|
|
|
i think you misunderstand how IP addresses and ports work
think of a street with 10 buildings, each building has 10 flats and each flat has its own mail box. Now in this example the IP would be the buildings physical address and the port number would be the flat number.
an IP points to a physical machine on a network and a port points to a specific service on that machine.
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
ok then use telnet<ipaddress port=""> if it gives the answer then u have the ip.
|
|
|
|
|
No you don't. All you have is the IP of a server with that port open. You may have multiple severs with the same port open. All of your servers may have that port open. You don't know you've got the one you were looking for.
There is no way to resolve a port address to an IP address.
Simon
|
|
|
|
|
you say server but you mean client i supose, right?!
If you are the client you have to know the server ip in order to connect to network (how would you locate him otherwise?), but you don´t know the ip addresses of others clients like you.
If you are the server you know the ip from all your clients ok?!
because if you let then in your network you get their id (meaning ip address).
Why don´t you download some server/client application here in codeproject to take a look at the code?!
|
|
|
|
|
thanks budy for ur cinsideration but will not keep a seperate check box. the check will be embeded in the datetimepicker.
Best Wishes
Kaustav Ganguly
Mindteck India
|
|
|
|
|
Reply on the trhread you started - not on a new one
I've just noticed, the dateTimePicker already has a check box which handles this automatically which can be made visible by setting the ShowCheckBox property.
Dave
|
|
|
|
|
hi,
I want to Attach event to html element in html file that opend with WebBrowser .
thanks.
Wafy
|
|
|
|
|
Hi,
I am 2 months into a new job and I have been looking at the structure of the main solution here, and one thing that puzzles me is the complete lack of any standards
2 questions I have are to do with USING directives:-
EG at the top of all of the forms is : using System.Windows.Forms;
but everywhere within code the whole name is qualified e.g :-
private System.Windows.Forms.TabPage tabCustomer;
this.tabCustomer = new System.Windows.Forms.TabPage();
1) Does this have any extra overhead with regards to performance?
2) Also, is it good practice to ensure that any namespaces are declaring at the top of the code?
Thanks in advance.
Janet
Lady Programmers are a rare breed!
|
|
|
|
|
Hi,
Visual Studio generates a couple of using statements automatically when
creating a new C# file.
The Visual Designer always generates code with fully qualified type names,
so no ambiguity can creep in.
Some people insist on not using using statements at all, and always have fully
qualified type names.
But as a programmer you are free to use or not use using statements, and to use or not use
fully qualified type names, as long as the compiler can find them and find them
without ambiguity.
There is no performance difference whatsoever.
|
|
|
|
|
Thanks for the prompt reply
glad to here there are no perfomance issues.
I have to admit that code is far easier to read without fully qualified type names.
Cheers again,
Janet
Lady Programmers are a rare breed!
|
|
|
|
|
You're welcome.
But_Im_a_Lady wrote: code is far easier to read without fully qualified type names.
That may change when your programs becomes very large though.
|
|
|
|
|
I have a program that tests DB tables. As these tests can take up to several minutes, I want to outsource them into other threads, to at least give the user to possibility to abort them/exit the application.
It's not intended that the user can execute several tests at a time, so I actually only need the main thread in which the Windows Form is running and a single worker thread that performs the test.
My main problem is that I run the test table by table in a loop and each time a table has finished testing, several dictionaries and controls are updated.
When the tests is performed by another thread, it means that the user can access the same dictionaries the testing thread is updating.
So far I just tried to get the testing thread running and allow the user to abort it but I didn't have much success yet.
I used the Windows Forms Invoke Method but that doesn't seem to help much, as the GUI still doesn't respond until the test is finished.
Could you tell me what approach would be best?
Should I use a ParameterizedThreadStart that gets passed a list of all dictionaries?
And how would I go about updating the Windows Forms controls? Create some event that is fired when a table has finished testing?
Thanks in advance.
|
|
|
|
|
Have a look at the BackgroundWorker component.
Dave
|
|
|
|
|
You could try to use the System.ComponentModel.BackgroundWorker class. The DB access takes place in an DoWork event handler.
For more information take a look at MSDN[^]
Hope this will help you.
PS: DaveyM69 was faster :=)
|
|
|
|
|
Thanks!
I've tried it and it seems the BackgroundWorker is indeed a good solution.
It's just a hassle, because during the test the worker thread needs to access a variety of lists and update several controls on the form.
I'm using ArrayLists as arguments to provide data for the worker thread and send the results of it to the form.
It's a bit awkward as I have to cast not only the argument object but also the content, is there any better solution that is more type safe?
|
|
|
|
|
Maybe create a class of data types/objects that may need to be passed back and report that object to the main thread. Just one cast will be needed then.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
There still is a little problem left, I'd appreciate if you could help me out again.
I was wondering whether or not a BackgroundWorker thread releases the locks on objects it held while doing the work, if it is canceled.
If not, is there a way to release the locks without using Monitor.Exit or using that method after I verified that the thread still owns the lock on the object?
|
|
|
|
|
ia m using pivot table in my c# application
my code is
SqlConnection cn=new SqlConnection("database=durdu;user id=sa;pwd=");
SqlDataAdapter cmd=new SqlDataAdapter ("select * from marksheet",cn);
DataSet ds = new DataSet();
DataTable dt=new DataTable();
cmd.Fill(ds);
dt = ds.Tables["Marksheet"];
axPivotTable1.DataSource=(msdatasrc.DataSource)(object)dt;
i have a problem because my pivot table does not show any data
is this a correct way i am bindind data to a pivit table or
what can i do to bind data in pivot table.
please provide me any code example how to bind data in a pivot table
thanks in advance
|
|
|
|
|
Please stop posting the same question. You've asked the same question 3 times in the last 24 hours, and have ignored the replies you already had. I suggest you revisit your earlier[^] questions, rather than opening up new ones.
|
|
|
|