is there any method in C# to which i pass ip address and subnetmask and it return true if given ip is in subnet mask?

For example, i give ip 192.168.0.149 and subnetmask 192.168.0.0 to the funtion and it return true................... Is there some thing like this in C#