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
Post a Comment