- UID
- 72810
注册时间2012-4-1
阅读权限50
最后登录1970-1-1
感悟天道
TA的每日心情 | 难过 2017-7-2 18:31 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
注册机源码(C#编写)
private void button1_Click(object sender, EventArgs e)
{
string s1 = textBox1.Text.Substring(2, 2);
string s2 = textBox1.Text.Substring(5, 2);
string s3 = textBox1.Text.Substring(12, 2);
double n1 = Convert.ToInt64(s3);
if (n1<10)
{
n1 += 10;
}
if(0==(n1%3))
{
n1 = (n1 + 9) * 3;
}
else
{
n1=n1*3;
}
double sum = Convert.ToInt64(s1) + Convert.ToInt64(s2) + 38;
double sin = System.Math.Sin(sum);
sin = Math.Abs(sin);
string result = sin.ToString();
if (result.Substring(2,1)=="0")
{
result = sin.ToString("e");
result=result.Substring(1,2);
}
else
{
result = result.Substring(2, 2);
}
//result = result.Substring(3, 2);
result = result.Replace(".", "3");
result = result.Replace("-", "5");
result = result.Replace("0", "8");
n1 += Convert.ToInt32(result.Substring(0, 1)) + Convert.ToInt32(result.Substring(1, 1));
Random rand = new Random(Guid.NewGuid().GetHashCode());
Int32 a;
string sn="";
for (int i = 0; i < 10;i++ )
{
a = rand.Next(0, 9);
sn += Convert.ToString(a);
n1 += a;
}
string n1s = Convert.ToString(n1);
n1s = n1s.Substring(n1s.Length - 2);
textBox2.Text = sn+result+n1s;
} |
|