Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: storing result into byte[] Pin
Pete O'Hanlon24-Jun-15 23:50
mvePete O'Hanlon24-Jun-15 23:50 
GeneralRe: storing result into byte[] Pin
Member 1171394227-Jun-15 0:39
Member 1171394227-Jun-15 0:39 
QuestionWinform MDI child form render not properly. Pin
kutty balaji24-Jun-15 20:42
kutty balaji24-Jun-15 20:42 
AnswerRe: Winform MDI child form render not properly. Pin
Dave Kreskowiak25-Jun-15 3:42
mveDave Kreskowiak25-Jun-15 3:42 
QuestionOwn Mail Server with own domain Pin
abhijit.mdccb24-Jun-15 20:20
abhijit.mdccb24-Jun-15 20:20 
AnswerRe: Own Mail Server with own domain Pin
Richard MacCutchan24-Jun-15 22:15
mveRichard MacCutchan24-Jun-15 22:15 
QuestionSaving stream as a PDF file to disk Pin
Member 1171394224-Jun-15 12:17
Member 1171394224-Jun-15 12:17 
AnswerRe: Saving stream as a PDF file to disk PinPopular
Sascha Lefèvre24-Jun-15 13:53
professionalSascha Lefèvre24-Jun-15 13:53 
You will receive the PDF in "plain binary", not JSON, so you can simply copy the stream contents into a file (-stream):
C#
string uri = "some pdf uri";
string filename = "some filepath";

HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(uri);
webRequest.Method = "GET";
webRequest.Accept = "application/pdf";

using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse())
{
    using (Stream responseStream = webResponse.GetResponseStream())
    {
        using (FileStream fileStream = File.Create(filename))
        {
            responseStream.CopyTo(fileStream);
        }
    }
}

If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: Saving stream as a PDF file to disk Pin
Member 1171394227-Jun-15 0:38
Member 1171394227-Jun-15 0:38 
QuestionHelp with Windows Form and IF statement Pin
Member 1147010024-Jun-15 9:04
Member 1147010024-Jun-15 9:04 
GeneralRe: Help with Windows Form and IF statement Pin
Sascha Lefèvre24-Jun-15 9:41
professionalSascha Lefèvre24-Jun-15 9:41 
GeneralRe: Help with Windows Form and IF statement Pin
Member 1147010024-Jun-15 11:19
Member 1147010024-Jun-15 11:19 
GeneralRe: Help with Windows Form and IF statement Pin
Sascha Lefèvre24-Jun-15 12:03
professionalSascha Lefèvre24-Jun-15 12:03 
QuestionStore one value from rows of data in a table Pin
Rajesh_198024-Jun-15 8:37
Rajesh_198024-Jun-15 8:37 
SuggestionRe: Store one value from rows of data in a table Pin
Richard Deeming24-Jun-15 8:51
mveRichard Deeming24-Jun-15 8:51 
GeneralRe: Store one value from rows of data in a table Pin
Rajesh_198025-Jun-15 4:15
Rajesh_198025-Jun-15 4:15 
QuestionCan we overload an abstract method of an abstract class? Pin
NJdotnetdev24-Jun-15 7:20
NJdotnetdev24-Jun-15 7:20 
AnswerRe: Can we overload an abstract method of an abstract class? Pin
Richard Deeming24-Jun-15 7:40
mveRichard Deeming24-Jun-15 7:40 
GeneralRe: Can we overload an abstract method of an abstract class? Pin
NJdotnetdev24-Jun-15 7:52
NJdotnetdev24-Jun-15 7:52 
AnswerRe: Can we overload an abstract method of an abstract class? Pin
maddymaddy1425-Jun-15 19:37
maddymaddy1425-Jun-15 19:37 
QuestionAn abstract singleton factory Pin
Marco Bertschi24-Jun-15 1:48
protectorMarco Bertschi24-Jun-15 1:48 
AnswerRe: An abstract singleton factory Pin
Eddy Vluggen24-Jun-15 2:35
professionalEddy Vluggen24-Jun-15 2:35 
GeneralRe: An abstract singleton factory Pin
Marco Bertschi24-Jun-15 2:48
protectorMarco Bertschi24-Jun-15 2:48 
GeneralRe: An abstract singleton factory Pin
Eddy Vluggen24-Jun-15 8:21
professionalEddy Vluggen24-Jun-15 8:21 
AnswerRe: An abstract singleton factory Pin
Richard Deeming24-Jun-15 4:29
mveRichard Deeming24-Jun-15 4:29 

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.