Click here to Skip to main content
15,891,725 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w3-Jun-20 2:39
arnold_w3-Jun-20 2:39 
AnswerRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
Gerry Schmitz3-Jun-20 6:40
mveGerry Schmitz3-Jun-20 6:40 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w3-Jun-20 9:30
arnold_w3-Jun-20 9:30 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
kalberts3-Jun-20 10:10
kalberts3-Jun-20 10:10 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w3-Jun-20 10:34
arnold_w3-Jun-20 10:34 
QuestionConverting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 3:52
Exoskeletor2-Jun-20 3:52 
AnswerRe: Converting InAppBilling.Plugin to Amazon Pin
OriginalGriff2-Jun-20 4:38
mveOriginalGriff2-Jun-20 4:38 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 4:56
Exoskeletor2-Jun-20 4:56 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
OriginalGriff2-Jun-20 5:18
mveOriginalGriff2-Jun-20 5:18 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 7:40
Exoskeletor2-Jun-20 7:40 
AnswerRe: Converting InAppBilling.Plugin to Amazon Pin
Kris Lantz2-Jun-20 9:13
professionalKris Lantz2-Jun-20 9:13 
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 

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.