How to check if a byte array is a valid image?
问题 I know there is no .Net function that exists for checking, but is there an algorithm or easy and effective way of checking if a byte is a valid image before I use the byte array. I need this because I'm sending different commands to a server who is constantly listening to the client and one of the commands is to get the screenshot of the server's computer. 回答1: You can try to generate an image from the byte array and check for the ArgumentException if its not. public static bool IsValidImage