Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
GeneralRe: User Control function C# Pin
Ralf Meier31-Jul-20 11:20
mveRalf Meier31-Jul-20 11:20 
GeneralRe: User Control function C# Pin
Ismael_19991-Aug-20 1:57
Ismael_19991-Aug-20 1:57 
GeneralRe: User Control function C# Pin
Ralf Meier1-Aug-20 22:49
mveRalf Meier1-Aug-20 22:49 
Questioncall a jquery function inside html returned by ajax Pin
Peq 227-Jul-20 21:36
Peq 227-Jul-20 21:36 
AnswerRe: call a jquery function inside html returned by ajax Pin
OriginalGriff27-Jul-20 22:02
mveOriginalGriff27-Jul-20 22:02 
QuestionAdd a listview cell Pin
ago248627-Jul-20 1:34
ago248627-Jul-20 1:34 
AnswerRe: Add a listview cell Pin
OriginalGriff27-Jul-20 2:28
mveOriginalGriff27-Jul-20 2:28 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 2:31
ago248627-Jul-20 2:31 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 2:59
mveOriginalGriff27-Jul-20 2:59 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 3:18
ago248627-Jul-20 3:18 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 3:37
mveOriginalGriff27-Jul-20 3:37 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:08
ago248627-Jul-20 4:08 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 4:38
mveOriginalGriff27-Jul-20 4:38 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:45
ago248627-Jul-20 4:45 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:53
ago248627-Jul-20 4:53 
Questionsaving a Word Doc from address bar in .net/C# Pin
Pita3225-Jul-20 5:50
Pita3225-Jul-20 5:50 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Gerry Schmitz25-Jul-20 7:19
mveGerry Schmitz25-Jul-20 7:19 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
DerekT-P25-Jul-20 9:22
professionalDerekT-P25-Jul-20 9:22 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Gerry Schmitz25-Jul-20 9:58
mveGerry Schmitz25-Jul-20 9:58 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
DerekT-P25-Jul-20 11:38
professionalDerekT-P25-Jul-20 11:38 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan25-Jul-20 21:59
mveRichard MacCutchan25-Jul-20 21:59 
Once you have read all the file data you just need to write it out to the place where it is to be saved:
C#
using (var documentReader = new StreamReader(fileContent.InputStream))
{
    var readDoc = documentReader.ReadToEnd();

    // write the text to a new file
    StreamWriter writer = new StreamWriter(saveasfilename);
    writer.Write(readDoc);
    writer.Close();
}

This is an over simplification, and could cause problems for Word document type files, as they are not text streams. A better solution would be to read and write byte arrays so the actual format of the file's content is copied verbatim.
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Pita3226-Jul-20 6:37
Pita3226-Jul-20 6:37 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan26-Jul-20 6:46
mveRichard MacCutchan26-Jul-20 6:46 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard Deeming26-Jul-20 23:50
mveRichard Deeming26-Jul-20 23:50 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan27-Jul-20 0:03
mveRichard MacCutchan27-Jul-20 0:03 

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.