This question already has answers here:
Writing a Virtual Printer in .NET [closed]
(7 answers)
Closed 5 years ago.
I am a fresher in c#. I have developed an application that can convert a postscript file(.ps) to formats like PDF,JPEG, ets,. My intention is to develop a pdf printer. So how do I add this application as a printer in windows xp or above. Or say how do I get the PS file when CTRL+P is pressed on any windows application.
This is not a network printer, its a printer that needs to be assigned to a local print port and not a network port.
You are asking, how to make a virtual printer in C#, a very good question, and an easy one, you can use some thing called:
- Virtual Printer Port Redirection, you can see the following questions and articles, they are very related to yours:
Writing a Virtual Printer in .NET
Configure Virtual Printer Port Redirection
http://msdn.microsoft.com/en-us/library/windows/hardware/br259124
Related
This question already has answers here:
C# - Get mac address in Universal Apps
(3 answers)
Closed 3 years ago.
I wanted to use the MAC Address of the device as a unique identifier, but this isn't exposed in the UWP API. The closest thing I can find is:
hostname.IPInformation.NetworkAdapter.NetworkAdapterId;
It seems to be the same value (after app restart and PC restart) but I don't know if it's robustly persistent. The docs don't seem to say, does anyone know what this ID actually consists of? Is it safe to use this as a reliable means of device identification?
If not, can someone recommend something?
Many thanks,
Peter
How is the NetworkAdapter.NetworkAdapterID generated in UWP
Derive from this case,
No, the NetworkAdapterId value is a GUID and has nothing to do with the machine MAC address. You cannot get the MAC adress of the computer through WinRT APIs exposed for the Windows Store application type.
This question already has answers here:
UWP How to get StorageDevice freespace and capacity?
(3 answers)
Closed 3 years ago.
I am creating a UWP application. I have a use case where I need to print the amount of free local storage available in GB on the windows device on which the app is running. How can this be done?
For this you can use the DriveInfo class. Following this link will provide you with examples System.IO - DriveInfo. Remember to take into consideration how to print the free storage if the device has more than one internal storage device.
This question already has answers here:
How do I retrieve a list or number of jobs from a printer queue?
(2 answers)
Closed 9 years ago.
I am trying to write a service that monitors the printers queue in C# that sends the information of a current print job (Document name, pages printed, paper media size) to an another application possibly that will then popup (like the Windows Msg "document has been sent to printer"). I am not sure if there is any examples or if anybody knows what classes are best used, being the printers are on a Windows printer server.
Thanks,
How do I retrieve a list or number of jobs from a printer queue? also doesn't completely match what I am asking, so read before marking as duplicate which it isn't.
Look into the System.Printing.PrintQueue class and the System.Printing.LocalPrintServer class - especially the GetDefaultPrintQueue method on the LocalPrintServer class
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Faking an RS232 Serial Port
I have an application that reads data from serial port. To test the application i would like to create a virtual serial port that generates data and puts the the port at the same PC, so that the other app can access that data.
Any idea how?
Thanks
I have used com0com tool for this. It has no direct API, but you can write an application (or a method) which starts a new com0com process to set up / modify your virtual ports "on the fly" with commandline parameters.
This question already has answers here:
Closed 12 years ago.
Possible Duplicates:
[.NET] How do I disable a system device?
Win32 API function to programatically enable/disable device
Is there a way, in C#, to programmatically disable and re-enable a device? I'm looking for essentially the same functionality that occurs when you go into device manager and right click on a device and disable or enable it. How can I do this in C#?
Take a look at net-how-do-i-disable-a-system-device.
According to this link: http://bytes.com/topic/c-sharp/answers/513855-can-i-use-wmi-c-disable-enable-device
You need to interface with CfgMgr32
(Win32 API) to do this.
My first thought was to look at WMI but it's not there.
DevCon, which comes with the Device Drive Toolkit, provides a CLI to do this.
http://msdn.microsoft.com/en-us/library/ff541193(VS.85).aspx