- UID
- 2
注册时间2004-12-1
阅读权限255
最后登录1970-1-1
总坛主
  
TA的每日心情 | 开心 2024-12-1 11:04 |
---|
签到天数: 12 天 [LV.3]偶尔看看II
|
发表于 2007-2-10 19:25:59
|
显示全部楼层
翻译成注册机,大家参考下:
VC++
- #include "iostream.h"
- #include "stdio.h"
- #include "windows.h"
- void main()
- {
- char Name[50];
- int Sum=0;
- cout<<"Please Input Your Name:\n";
- cin>>Name;
- for(int i=0;i<unsigned(strlen(Name));i++){
- Sum+=Name[i];
- Sum^=0x1688;
- }
- cout<<"Your Serial is:\n"<<Sum<<"-"<<Name<<endl;
- getchar();
- }
复制代码
VB
- Private Sub Command1_Click()
- Dim Name As String
- Dim i As Integer
- Dim Sum As Integer
- Name = Text1.Text
- If Name <> "" Then
- For i = 1 To Len(Name)
- Sum = Sum + Asc(Mid(Name, i, 1))
- Sum = Sum Xor &H1688
- Next
- Text2.Text = Sum & "-" & Name
- End If
- End Sub
复制代码 |
|