How To Authenticate Clients to printing From Server Using ASP.NET C#

i have one server in which the printer is installed, the clients are printing from server. So, i want to authenticate those clients before printing using

means if in server client architecture of any company,
clients are printing from any type of application like
word, power point, excel or even from web browser,

i want to stop them to printing unlimited prints,

one application is currently running, clients logins are also available in it, so using those login i want to give rights for printing.

i am talking about system printing from any application and authenticate them using application.

if it's possible?

can anyone give me idea or code for print authentication from client computer to server?

You can restrict access to that specific print page as follows in your web.config file :

<authentication mode="Forms" />
<location path="printPage.aspx">
<deny users="?"/>
<allow users="*" />

this will prevent all the anonymous users from accessing the page and will allow only the authenticated users to display it.