473,765 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Its Urgent,Please Reply

Hi Friends !
Can anyone help? Its an urgent.
I wanted to print PDF Document or Scanned Document Through
my .aspx page .By just clicking a button.I'm not using
codebehind.I want to do printing at my network printer.

I'm using System.Diagnosi cs.Process Namespace for calling
the print process at the server where i want to do my
printing.I'm only able to run Command.exe and notepad
process. Please help.

My code :

Public Sub PrintDoc(sender as Object, ev As EventArgs)
dim ERROR_FILE_NOT_ FOUND As Integer = 2
dim ERROR_ACCESS_DE NIED As Integer = 5
Dim myProcess As New Process()

Try
myProcess.Start Info.FileName =
FileName response.Write
(myProcess.Star tInfo.FileName)

myProcess.Start Info.Verb = "Print"

myProcess.Start Info.UseShellEx ecute=true
myProcess.Start Info.CreateNoWi ndow = True
myProcess.Start ()

Catch e As Win32Exception
response.Write( "error")
If e.NativeErrorCo de = ERROR_FILE_NOT_ FOUND
Then
Response.Write( ((e.Message + ". Check the
path.")))

Else
If e.NativeErrorCo de = ERROR_ACCESS_DE NIED
Then
' Note that if your word processor might
generate exceptions
' such as this, which are handled first.
Response.Write( ((e.Message + ". You do
not have permission to print this file.")))
End If
End If
End Try
myProcess.WaitF orExit()
if Not myProcess.HasEx ited Then
myProcess.Kill( )
End If
myProcess.Close ()

End Sub

--
Amrendra
EName:am******@ dosplindia.com
Ph. :91-124-5048883-5
Fax:91-124-5048887
Nov 17 '05 #1
0 1160

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

Similar topics

0
1619
by: felix_william | last post by:
Attention=3A Dear friend=2C REQUEST FOR BUSINESS RELATIONSHIP OF GREAT PROFITS I am HON=2E =28DR=2E=29 Felix William=2C the Director of Procurement and Contract Award at the Nigerian National Petroleum Corporation =28NNPC=29 of the Federal Republic of Nigeria=2E I apologized using this medium to reach you for a transaction=2F business of this magnitude=2C but this is due to Confidentiality and prompt access reposed on this medium=2E It is...
0
1229
by: mohemed _altdou | last post by:
Mr mohemed altdou The Manager of Audit & Accountancy Dept. African Development Bank/ADB. Ouagadougou, Burkina-Faso. ( READ CAREFULLY AND KEEP SECRET) Greeting, and how are you doing?I hope fine.Please let this my message do not be a surprise to you because i got your information and lay trust in you before i contacted you.I am the MANAGER OF AUDIT & ACCOUNTANCY DEPARTMENT of our bank and i decided to contact you over this financial...
2
1642
by: Bill Yin | last post by:
Please tell me where can download <Beginning C# web Applications with Visual studio .net> 's code Thanks in advance!
19
383
by: Major | last post by:
please help me i want to connect sql serevr with visual basic form but i can't note: (i'm biggner in both of them ) please reply me quickly but please step by step
33
3436
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
1
1423
by: razaqtelecom | last post by:
Hi, I want to know how can i write a stored procedure for the following sceario. Take if there are three tables, table1, table2, table3 and table1 is linked with table2 and table 2 is linked with table3. Now i have to compare a data in table 3 for one of the rows in table1 where as For the same row in table1 there will 100 rows in table 2 and for each row in table2 there will be 100 rows in table 3. So I need to write a stored...
1
1924
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this socket. some time error is---"An existing connection was forcibly closed by the remote host" and some time error is--- "A connection attempt failed because the connected party did not properly respond after a period of time, or established...
17
2288
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all scripts. each when clicked i am able to run the script. so HOW and what do i do to call and run the .sql Thanks
4
2955
by: Adrian Parker | last post by:
We've suddenly started getting a problem with a call to clear the contents of a DataTable. This is on a live customer site that's been working fine until yesterday. As far as we know they've not changed or updated the server in any way. "There is no row at position 42" at System.Data.RBTree`1.GetNodeByIndex(int32 userIndex) at System.Data.DataTable.Clear(Boolean clearAll) at system.Data.DataTable.Clear()
6
1477
by: thijo | last post by:
public class Point { private int x; private int y; private int Number;
0
9398
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
10156
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
10007
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
9951
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
8831
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
7375
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...
1
3924
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
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.