aaaa bvvv

aaaa bvvv

  • NA
  • 5
  • 0

how to make if condition true please check the code c#

Jun 28 2008 1:54 AM

on the button click the below methods are fired, just change the email and reg code to make the if condition true please help me how i can make the flag true or if condition true thx

 

 

//Button code-------------------------------

private void button2_Click(object sender, EventArgs e)

{

//#----------put the email here and regcode and make the condition true;

CheckRegistration("your email [email protected]", "your reg code here");

}

//---------------------------

 

 

 

 

 

public bool CheckRegistration(string _regMail, string _regCode)

{

bool flag = false;

non = _regCode;

//#---------- you have to make this condition true

if (((_regMail.Length > 5) && (_regCode.Length > 7)) && GetRegCode(_regMail).Equals(_regCode))

{

flag = true;

int k = 0;

}

//#--------- Make this flag true...!

MessageBox.Show(flag.ToString());

return flag;

}

private static int ConvReg(char _c)

{

int num = 0x2a;

char[] chArray = new char[] {

'q', '1', 'c', 'a', 'x', 'l', '-', '7', 'u', 'd', '3', 'b', '2', '9', 'n', 'g',

'f', 'v', 't', 'j', 'k', '5', 'm', 'e', 'o', 'p', '6', '@', 's', 'i', '8', 'h',

'w', '4', 'y', '_', '0', 'r', '.', 'z'

};

for (int i = 0; i < chArray.Length; i++)

{

if (_c == chArray[i])

{

num = i;

}

}

// MessageBox.Show(num.ToString());

return num;

}

 

public static string GetRegCode(string _regMail)

{

string str = "2X";

if (_regMail.Length > 5)

{

char[] chArray = _regMail.ToLower().ToCharArray();

int index = _regMail.IndexOf("@");

str = (((str + ConvReg(chArray[0]).ToString()) + ConvReg(chArray[1]).ToString() + ConvReg(chArray[index - 1]).ToString()) + _regMail.Length.ToString() + ConvReg(chArray[index + 1]).ToString()) + ConvReg(chArray[index + 2]).ToString() + ConvReg(chArray[_regMail.Length - 1]).ToString();

}

// MessageBox.Show(str+" <-->"+non);

return str;

}


Answers (1)