ftp - Cannot convert 'double' to 'int' C# -


i have code =>

var timer = new system.threading.timer((e) => {     upload(); }, null, 0, timespan.fromminutes(5).totalmilliseconds); 

it supposed execute method every 5 minutes, keeps throwing error: cannot convert 'double' 'int'. making no sense because have had other strings in there "upload()", such "ftpfileuploader.upload()" , work fine. though don't want that... please help... in advance!

system.threading.timer takes integer, following code returns double

timespan.fromminutes(5).totalmilliseconds  

so need cast integer:

(int)timespan.fromminutes(5).totalmilliseconds 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -