Click here to Skip to main content
15,894,955 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# Pin
ambarishtv29-Apr-11 22:51
ambarishtv29-Apr-11 22:51 
AnswerRe: c# Pin
Prasanta_Prince30-Apr-11 7:14
Prasanta_Prince30-Apr-11 7:14 
QuestionFile access permissions in program files folder Pin
lukeer29-Apr-11 3:46
lukeer29-Apr-11 3:46 
AnswerRe: File access permissions in program files folder Pin
dan!sh 29-Apr-11 5:26
professional dan!sh 29-Apr-11 5:26 
AnswerRe: File access permissions in program files folder Pin
Luc Pattyn29-Apr-11 8:09
sitebuilderLuc Pattyn29-Apr-11 8:09 
GeneralRe: File access permissions in program files folder Pin
lukeer1-May-11 21:04
lukeer1-May-11 21:04 
AnswerRe: File access permissions in program files folder Pin
Luc Pattyn1-May-11 22:50
sitebuilderLuc Pattyn1-May-11 22:50 
QuestionHow to add the data from list to a class objects Pin
Rocky2329-Apr-11 0:59
Rocky2329-Apr-11 0:59 
QuestionRemoving "Back-Slash \" from string Pin
M Riaz Bashir28-Apr-11 23:09
M Riaz Bashir28-Apr-11 23:09 
AnswerRe: Removing "Back-Slash \" from string Pin
loveangel88828-Apr-11 23:15
loveangel88828-Apr-11 23:15 
GeneralRe: Removing "Back-Slash \" from string Pin
M Riaz Bashir28-Apr-11 23:23
M Riaz Bashir28-Apr-11 23:23 
GeneralRe: Removing "Back-Slash \" from string Pin
Richard MacCutchan29-Apr-11 0:46
mveRichard MacCutchan29-Apr-11 0:46 
AnswerRe: Removing "Back-Slash \" from string Pin
Blue_Boy28-Apr-11 23:18
Blue_Boy28-Apr-11 23:18 
AnswerRe: Removing "Back-Slash \" from string PinPopular
David198729-Apr-11 1:30
David198729-Apr-11 1:30 
AnswerRe: Removing "Back-Slash \" from string Pin
Prasanta_Prince29-Apr-11 5:49
Prasanta_Prince29-Apr-11 5:49 
AnswerRe: Removing "Back-Slash \" from string Pin
wizardzz29-Apr-11 7:23
wizardzz29-Apr-11 7:23 
QuestionBinding a Method Pin
dbongs28-Apr-11 21:52
dbongs28-Apr-11 21:52 
AnswerRe: Binding a Method Pin
Pete O'Hanlon28-Apr-11 23:03
mvePete O'Hanlon28-Apr-11 23:03 
GeneralRe: Binding a Method Pin
dbongs28-Apr-11 23:14
dbongs28-Apr-11 23:14 
GeneralRe: Binding a Method Pin
Pete O'Hanlon29-Apr-11 2:32
mvePete O'Hanlon29-Apr-11 2:32 
QuestionFileUpload Component question. Pin
buffering8328-Apr-11 19:38
buffering8328-Apr-11 19:38 
AnswerRe: FileUpload Component question. Pin
dan!sh 28-Apr-11 20:04
professional dan!sh 28-Apr-11 20:04 
AnswerRe: FileUpload Component question. Pin
Pete O'Hanlon28-Apr-11 21:00
mvePete O'Hanlon28-Apr-11 21:00 
AnswerRe: FileUpload Component question. Pin
dbongs28-Apr-11 21:54
dbongs28-Apr-11 21:54 
QuestionHow to print a file (word doc, pdf or infopath form) from a URL using code? Pin
bin_bin128-Apr-11 19:21
bin_bin128-Apr-11 19:21 
Hello there,

I am trying to print a file(could be word, pdf or infopath form) from URL using c# code. But I always got "The parameter is incorrect" error.
The following is the code that I used.

WindowsImpersonationContext wic = WindowsIdentity.GetCurrent().Impersonate();
Process printJob = new Process();
printJob.StartInfo.FileName = @"http://testsrv/test1/Shared%20Documents/test.txt";
printJob.StartInfo.UseShellExecute = true;
printJob.StartInfo.Verb = "print";
printJob.Start();

I am sure the URL is correct.

I also tried to download the file to local drive and use the local full file path instead. In that case, it doesn't print and there is no exception either.

I am really confused. Please help.

My code is running in an ashx handler. I don't know whether that makes different or not.

Thank you very much in advance.

Bin

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.