pravim zastitu za textbox i imam pitanje: Kako mogu da prebacim string u vrednost ASCII?
Nesto sam pokusavao, evo ga deo koda, nesto mi pise iz VB.NET, ali ovde to ne funkcionise.
Code:
string brmob;
int asckod;
bool pogresanbrmob;
pogresanbrmob = false;
brmob = e.KeyChar.ToString();
asckod = ASCIIEncoding(brmob);
if (!((brmob >= (48)) & (brmob <= Strings.Chr(57))) | (brmob = Strings.Chr(8)))
{
if (txtbroj.TextLength < 10000000)
{
pogresanbrmob = true;
}
}
if (pogresanbrmob == true)
{
MessageBox.Show("Unesite brojčanu vrednost!","Greska",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
e.KeyChar. = "";
}
string brmob;
int asckod;
bool pogresanbrmob;
pogresanbrmob = false;
brmob = e.KeyChar.ToString();
asckod = ASCIIEncoding(brmob);
if (!((brmob >= (48)) & (brmob <= Strings.Chr(57))) | (brmob = Strings.Chr(8)))
{
if (txtbroj.TextLength < 10000000)
{
pogresanbrmob = true;
}
}
if (pogresanbrmob == true)
{
MessageBox.Show("Unesite brojčanu vrednost!","Greska",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
e.KeyChar. = "";
}
Hvala unapred!