I have to allow upload of two different types of image dimension image can either be of width 370 or 602
How can I check it using if image width 370 or 602
with if statement.
If image width are correct then it is okay otherwise I delete the file.
Below code always fails even as either if dimension doesn't match. How can I make below to allow either dimension?
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World");
int imgW = 370; // assuming image width is 370
if (imgW != 370 || imgW != 602)
{
Console.WriteLine("One");
}
else
{
Console.WriteLine("Two");
}
}
}
if (imgW == 370 || imgW == 602)
? Or do I misunderstand?if (imgW != 370 && imgW != 602)
. This is the same asif (!(imgW == 370 || imgW == 602))
orif (imgW == 370 || imgW == 602)
but with switched bodies