question

GGunnfs-5814 avatar image
0 Votes"
GGunnfs-5814 asked GGunnfs-5814 commented

how to fix "CS0121 The call is ambiguous between the following methods or properties: 'Thread.Thread(ThreadStart)' and 'Thread.Thread(ParameterizedThreadStart)'"?

the offending code has
using System;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Threading;

and the flagged statement:
new Thread(delegate { getStockInfo(reslt); }).Start();
........

 void getStockInfo(string Reslt)
 {
 .............
 }

reslt is of type string and has been assigned value before the thread start.
this is the first attempt to to use thread

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered GGunnfs-5814 commented

Try a short fix:

new Thread( ( ) => getStockInfo( reslt ) ).Start( );

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thank you!

0 Votes 0 ·