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

C#

 
AnswerRe: Using static var on a class Pin
OriginalGriff30-Nov-15 6:32
mveOriginalGriff30-Nov-15 6:32 
GeneralRe: Using static var on a class Pin
Richard Deeming30-Nov-15 6:40
mveRichard Deeming30-Nov-15 6:40 
AnswerThanks everyone,someone knows the answer for B. ? Pin
Member 1217642830-Nov-15 6:52
Member 1217642830-Nov-15 6:52 
GeneralRe: Thanks everyone,someone knows the answer for B. ? Pin
Eddy Vluggen30-Nov-15 7:11
professionalEddy Vluggen30-Nov-15 7:11 
GeneralRe: Thanks everyone,someone knows the answer for B. ? Pin
BillWoodruff30-Nov-15 9:09
professionalBillWoodruff30-Nov-15 9:09 
AnswerRe: Using static var on a class Pin
BillWoodruff30-Nov-15 9:17
professionalBillWoodruff30-Nov-15 9:17 
QuestionMy problem Pin
Member 1217509329-Nov-15 19:17
Member 1217509329-Nov-15 19:17 
AnswerRe: My problem Pin
BillWoodruff29-Nov-15 20:52
professionalBillWoodruff29-Nov-15 20:52 
Make it easy by using what .NET provides:
C#
// required
using System.IO;

// folder paths
string f1 = @"C:\test1";
string f2 = @"C:\test2";
// file name
string fname = "someJPG.jpg";

private void MoveFile(string folder1, string folder2, string filename)
{
    string filePath1 = Path.Combine(folder1, filename);

    // valid paths ?
    if ((!File.Exists(filePath1)) || (! Directory.Exists(folder2)))
    {
        throw new ArgumentException("invalid file or folder path");
    }

    try
    {
        File.Move(filePath1, Path.Combine(folder2, filename));
    }
    catch (Exception ex)
    {
        Console.WriteLine("{0} error moving file", ex.Message);
    }
}

// call like this:
// MoveFile(f1,f2,fname);

«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.

Questionhow to use delegate to call function and introduce function as content? Pin
smallkubi29-Nov-15 18:31
smallkubi29-Nov-15 18:31 
AnswerRe: how to use delegate to call function and introduce function as content? Pin
BillWoodruff29-Nov-15 20:04
professionalBillWoodruff29-Nov-15 20:04 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi29-Nov-15 20:42
smallkubi29-Nov-15 20:42 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
Pete O'Hanlon29-Nov-15 21:39
mvePete O'Hanlon29-Nov-15 21:39 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
BillWoodruff29-Nov-15 22:52
professionalBillWoodruff29-Nov-15 22:52 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi30-Nov-15 2:27
smallkubi30-Nov-15 2:27 
AnswerRe: how to use delegate to call function and introduce function as content? Pin
Richard Deeming29-Nov-15 23:18
mveRichard Deeming29-Nov-15 23:18 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi30-Nov-15 3:02
smallkubi30-Nov-15 3:02 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
Richard Deeming30-Nov-15 3:17
mveRichard Deeming30-Nov-15 3:17 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi30-Nov-15 4:24
smallkubi30-Nov-15 4:24 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
Eddy Vluggen30-Nov-15 4:55
professionalEddy Vluggen30-Nov-15 4:55 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi30-Nov-15 5:02
smallkubi30-Nov-15 5:02 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
Eddy Vluggen30-Nov-15 7:03
professionalEddy Vluggen30-Nov-15 7:03 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi30-Nov-15 15:48
smallkubi30-Nov-15 15:48 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
Eddy Vluggen30-Nov-15 23:16
professionalEddy Vluggen30-Nov-15 23:16 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
smallkubi1-Dec-15 13:59
smallkubi1-Dec-15 13:59 
GeneralRe: how to use delegate to call function and introduce function as content? Pin
Eddy Vluggen1-Dec-15 23:59
professionalEddy Vluggen1-Dec-15 23:59 

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.