Hi all,
I'm looking for the C# equivalent of the line below.
If New FileInfo(c:\images\test.jpg).Length < 25 * 1024 Then
'something
End If
Thannks for the help.
Hi all,
I'm looking for the C# equivalent of the line below.
If New FileInfo(c:\images\test.jpg).Length < 25 * 1024 Then
'something
End If
Thannks for the help.
At least that's a straightforward one.
if (new FileInfo(@"c:\images\test.jpg").Length < (25 * 1024))
{
// something
}
The @-sign disables backslash escape processing in the string.
if (new FileInfo(@"c:\Images\test.jpg").Length < 25 * 1024)
{
// something
}
if(new FileInfo(@"c:\images\test.jpg").Length < 1024 * 4))
{
// something
}
I'd recommend checking out these free conversion sites for questions like these:
http://www.developerfusion.com/tools/convert/vb-to-csharp/
http://converter.telerik.com/