Need help with a C# Programm
Go to solution
Solved by madknight3,
Is there no other way because I will need to get something so I can still use my Base system
the example is what is also in my code;
mZ1 = Convert.ToInt32(value, 2);
I'm not sure what you're looking for. Convert.ToSByte, and all other Convert methods will throw an OverflowException. They are all internally using a cast like how I showed you. For example, here's how Convert.ToSByte is implemented.
[CLSCompliant(false)]public static sbyte ToSByte(long value) { if (value < SByte.MinValue || value > SByte.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_SByte")); Contract.EndContractBlock(); return (sbyte)value; }
As you can see, the method does (sbyte)value, which is what I showed you, but it also does the overflow check which you don't want.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now