Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Npgsqlcommand parameterization doesn't always escape single quote Pin
OriginalGriff21-Apr-18 22:44
mveOriginalGriff21-Apr-18 22:44 
QuestionPSFEATURE_CUSTPAPER structure - change paper size in virtual printer Pin
Member 1308759421-Apr-18 9:30
Member 1308759421-Apr-18 9:30 
Questionusbclass library Pin
Member 1379116421-Apr-18 4:58
Member 1379116421-Apr-18 4:58 
AnswerRe: usbclass library Pin
OriginalGriff21-Apr-18 5:00
mveOriginalGriff21-Apr-18 5:00 
AnswerRe: usbclass library Pin
jschell21-Apr-18 6:23
jschell21-Apr-18 6:23 
QuestionStateChange event issue in SQL Server 2016 and .net 4.7 ado.net Pin
Arun TBalakrishnan20-Apr-18 14:18
Arun TBalakrishnan20-Apr-18 14:18 
AnswerRe: StateChange event issue in SQL Server 2016 and .net 4.7 ado.net Pin
Gerry Schmitz20-Apr-18 20:19
mveGerry Schmitz20-Apr-18 20:19 
QuestionHow can we copy and move folders in one folder to another folder. Pin
Member 1377710419-Apr-18 20:14
Member 1377710419-Apr-18 20:14 
C#
    void BtncopyClick(object sender, EventArgs e)
    {
        string filename=@"E:\\Files\\Reports\\R^ECG^_0_1688^Jones^^_20160711065157_20160711065303 - Copy (4) - Copy.pdf";
        string sourcepath=@"E:\\Anusha";
        string targetpath=@"E:\\Anusha\\aaa";

        string sourcefile= System.IO.Path.Combine(sourcepath,filename);
        string destfile= System.IO.Path.Combine(targetpath,filename);
        if (!System.IO.Directory.Exists(targetpath))
        {
        System.IO.Directory.CreateDirectory(targetpath);
        }
      System.IO.File.Copy(sourcefile, destfile, true);
        if (System.IO.Directory.Exists(sourcepath))
    {
        string[] files = System.IO.Directory.GetFiles(sourcepath);

        // Copy the files and overwrite destination files if they already exist.
        foreach (string s in files)
        {
            // Use static Path methods to extract only the file name from the path.
            filename = System.IO.Path.GetFileName(s);
            destfile = System.IO.Path.Combine(targetpath, filename);
            System.IO.File.Copy(s, destfile, true);
        }
    }
    else
    {
        MessageBox.Show("File doesn't exist");
    }
}
    void BtnmoveClick(object sender, EventArgs e)
    {
        String path = "E:\\Files\\25-11-2017";
        String path2 = "E:\\Anusha\\aaa\\25-11-2017";

    if (!File.Exists(path))
    {
        {
            // This statement ensures that the file is created,
            // but the handle is not kept.
            using (FileStream fs = File.Create(path)) {}
        }

        System.IO.Directory.Move("E:\\Files\\25-11-2017",@"E://Anusha//aaa");

        // Move the file.
        File.Move(path, path2);
        MessageBox.Show("File Moved");
        }
 }


i HAVE WRITTEN BELOW code to copy and move the folder ,I am not getting any compiling errors but while i am trying to click on button on output form it was showing as termination.

AnswerRe: How can we copy and move folders in one folder to another folder. Pin
OriginalGriff19-Apr-18 21:35
mveOriginalGriff19-Apr-18 21:35 
AnswerRe: How can we copy and move folders in one folder to another folder. Pin
BillWoodruff20-Apr-18 3:29
professionalBillWoodruff20-Apr-18 3:29 
GeneralRe: How can we copy and move folders in one folder to another folder. Pin
OriginalGriff20-Apr-18 4:09
mveOriginalGriff20-Apr-18 4:09 
GeneralRe: How can we copy and move folders in one folder to another folder. Pin
BillWoodruff20-Apr-18 15:32
professionalBillWoodruff20-Apr-18 15:32 
AnswerRe: How can we copy and move folders in one folder to another folder. Pin
Gerry Schmitz20-Apr-18 7:09
mveGerry Schmitz20-Apr-18 7:09 
QuestionPLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Jens Eckervogt 19-Apr-18 11:03
Jens Eckervogt 19-Apr-18 11:03 
AnswerRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Gerry Schmitz20-Apr-18 7:26
mveGerry Schmitz20-Apr-18 7:26 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Jens Eckervogt 20-Apr-18 10:21
Jens Eckervogt 20-Apr-18 10:21 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Gerry Schmitz20-Apr-18 12:37
mveGerry Schmitz20-Apr-18 12:37 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Jens Eckervogt 21-Apr-18 0:04
Jens Eckervogt 21-Apr-18 0:04 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Jens Eckervogt 20-Apr-18 9:39
Jens Eckervogt 20-Apr-18 9:39 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Gerry Schmitz20-Apr-18 13:08
mveGerry Schmitz20-Apr-18 13:08 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Pete O'Hanlon20-Apr-18 22:11
mvePete O'Hanlon20-Apr-18 22:11 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Jens Eckervogt 21-Apr-18 5:15
Jens Eckervogt 21-Apr-18 5:15 
GeneralRe: PLEASE HELP ME - I have problem with OpenTK and Loading WaveFront ( obj without materials ) Pin
Pete O'Hanlon21-Apr-18 5:38
mvePete O'Hanlon21-Apr-18 5:38 
Questionc# how to Temporary pause button click event until mousedoubleclick on new form-listbox shown? Pin
Member 1376930818-Apr-18 23:06
Member 1376930818-Apr-18 23:06 
AnswerRe: c# how to Temporary pause button click event until mousedoubleclick on new form-listbox shown? Pin
Eddy Vluggen18-Apr-18 23:10
professionalEddy Vluggen18-Apr-18 23:10 

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.