Click here to Skip to main content
15,885,782 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 9:24
Exoskeletor2-Jun-20 9:24 
QuestionState machine performance woes in .NET Pin
kalberts2-Jun-20 3:04
kalberts2-Jun-20 3:04 
AnswerRe: State machine performance woes in .NET Pin
kalberts2-Jun-20 3:41
kalberts2-Jun-20 3:41 
GeneralRe: State machine performance woes in .NET Pin
F-ES Sitecore2-Jun-20 4:08
professionalF-ES Sitecore2-Jun-20 4:08 
QuestionProblem with Currency format Column Calculation in my dGV in C# Winform Application. Pin
Member 1467808531-May-20 6:47
Member 1467808531-May-20 6:47 
AnswerRe: Problem with Currency format Column Calculation in my dGV in C# Winform Application. Pin
OriginalGriff31-May-20 20:34
mveOriginalGriff31-May-20 20:34 
QuestionMulti threading in C# Pin
bjwaldo28-May-20 9:21
bjwaldo28-May-20 9:21 
AnswerRe: Multi threading in C# Pin
JudyL_MD28-May-20 10:45
JudyL_MD28-May-20 10:45 
The function that you give in the Thread constructor takes parameters, therefore ThreadStart is wanting those parameters. Looking at the documentation (HINT HINT HINT), you will see two variants of Thread: one with parameters in the target function and one without parameters. You want parameters, but the documentation says you can only pass ONE parameter. You will need a version of your CopyDirectory that takes one object containing your two parameters -- a class or struct. Something like this (my C# syntax may be off slightly since I'm not compiling this):
class CopyParameters
{
	public string source;
	public string target;
}

public void CopyDirectoryThreaded (Object obj)
{
	string source = ((CopyParameters) obj).source;
	string target = ((CopyParameters) obj).target;
	CopyDirectory (source, target);
}

and then your calling code looks like
CopyParameters params = new CopyParameters ();
params.source = source.ToString ();
params.target = target.ToString ();

var bkpthread = new Thread(CopyDirectoryThreaded)
{
	IsBackground = true
};
bkpthread.Start(params);


Note that you have no way of detecting when your threaded copy is done, nor any protection to prevent two threads from messing with the same directories. You should have both.
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein

AnswerRe: Multi threading in C# Pin
F-ES Sitecore29-May-20 1:17
professionalF-ES Sitecore29-May-20 1:17 
GeneralRe: Multi threading in C# Pin
bjwaldo30-May-20 7:30
bjwaldo30-May-20 7:30 
QuestionLinq TO SQL - Pass Table Name Pin
Kevin Marois28-May-20 8:57
professionalKevin Marois28-May-20 8:57 
AnswerRe: Linq TO SQL - Pass Table Name Pin
Richard Deeming29-May-20 0:11
mveRichard Deeming29-May-20 0:11 
QuestionC# How To Get Version Info Of exe in FTP Pin
Ertuğrul ÇİÇEK28-May-20 3:16
Ertuğrul ÇİÇEK28-May-20 3:16 
AnswerRe: C# How To Get Version Info Of exe in FTP Pin
Richard MacCutchan28-May-20 3:19
mveRichard MacCutchan28-May-20 3:19 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Ertuğrul ÇİÇEK28-May-20 3:41
Ertuğrul ÇİÇEK28-May-20 3:41 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Richard MacCutchan28-May-20 3:43
mveRichard MacCutchan28-May-20 3:43 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Richard Deeming28-May-20 3:53
mveRichard Deeming28-May-20 3:53 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
OriginalGriff28-May-20 3:57
mveOriginalGriff28-May-20 3:57 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Ertuğrul ÇİÇEK28-May-20 6:32
Ertuğrul ÇİÇEK28-May-20 6:32 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Richard Deeming28-May-20 8:32
mveRichard Deeming28-May-20 8:32 
QuestionCreating and Binding UI objects in C# instead of XAML (WPF) Pin
Member 1484454026-May-20 12:04
Member 1484454026-May-20 12:04 
AnswerRe: Creating and Binding UI objects in C# instead of XAML (WPF) Pin
Mycroft Holmes26-May-20 12:26
professionalMycroft Holmes26-May-20 12:26 
AnswerRe: Creating and Binding UI objects in C# instead of XAML (WPF) Pin
Richard Deeming27-May-20 1:01
mveRichard Deeming27-May-20 1:01 
QuestionHow to mount an ISO file with disc type - CD/DVD Pin
Member 1001484126-May-20 6:43
Member 1001484126-May-20 6:43 
AnswerRe: How to mount an ISO file with disc type - CD/DVD Pin
Richard MacCutchan26-May-20 6:48
mveRichard MacCutchan26-May-20 6:48 

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.