- UID
- 2
注册时间2004-12-1
阅读权限255
最后登录1970-1-1
总坛主
TA的每日心情 | 开心 2024-12-1 11:04 |
---|
签到天数: 12 天 [LV.3]偶尔看看II
|
发表于 2007-2-10 20:03:02
|
显示全部楼层
原帖由 ww-jack 于 2007-2-10 18:22 发表
private void button3_Click(object sender, EventArgs e)
{
foreach (char ch1 in this.textBox1.Text)
{
foreach (char ch2 in this.textBox1.Text)
{
...
这样写代码会存在BUG,造成多个用户名有同一个注册码,呵呵!
例:
chinapyg.com
www.chinapyg.com
对应的注册码都是:
327521
不过,我猜你是故意的,这2个域名本来都指向PYG嘛!哈~:victory:
贴上注册机源码(按照作者的格式翻译),方便楼下的参考:
VB:
- Private Sub Command1_Click()
- Dim name As String
- Dim i, j, k As Integer
- Dim lenname As Integer
- Dim sum As Long
- name = Text1.Text
- lenname = Len(name)
- For i = 1 To lenname
- For j = 1 To lenname
- For k = 1 To lenname
- sum = Asc(Mid(name, i, 1)) + Asc(Mid(name, j, 1)) + Asc(Mid(name, k, 1)) & "521"
- Next
- Next
- Next
- Text2.Text= sum
- End Sub
复制代码
VC++
- #include "iostream.h"
- #include "stdio.h"
- #include "windows.h"
- void main()
- {
- char Name[50];
- int Sum=0;
- int LenName=0;
- cout<<"Please Input Your Name:\n";
- cin>>Name;
- LenName = unsigned(strlen(Name));
- for(int i=0;i<LenName;i++)
- {
- for(int j=0;j<LenName;j++)
- {
- for(int k=0;k<LenName;k++)
- {
- Sum = Name[i]+Name[j]+Name[k];
- }
- }
- }
- cout<<"Your Serial is:\n"<<Sum<<"521"<<endl;
- getchar();
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入我们
x
|