using System;
using System.Collections.Generic;
using System.Text;namespace zjlDoor
{
class Program
{
static void Main(string[] args)
{
Database db = new Database();
lll:
try
{
print();//adduser zjl 123
string command = Console.ReadLine();
string[] cmd = command.Split(new char[] { ' ' });
if (cmd[0].Equals("adduser"))
{
print();
if (db.not_sel("insert into t_user(userid,password) values('" + cmd[1] + "','" + cmd[2] + "')"))
Console.WriteLine("成功插入!");
else
Console.WriteLine("插入失败,手艺太潮!");
}
else if (cmd[0].Equals("addmoney"))
{
print();
if (db.not_sel("update t_user set account=account+" + cmd[2] + " where userid='" + cmd[1] + "'"))
Console.WriteLine("修改成功!");
else
Console.WriteLine("修改失败,手艺太潮!");
}
else if (cmd[0].Equals("quit"))
return;
else
Console.WriteLine("命令错误!");
goto lll;
}
catch (Exception ee) { Console.WriteLine(ee.Message); goto lll; }
}
private static void print()
{
Console.Write("zjl command line>>>");
}
}
}请各位大侠帮忙,这里的print()函数起什么作用啊?而且也没有参数,我是初学c#的,输出的时候没用过这个函数,请大家帮忙讲一下,还有就是那个lll:标识符的用法,我也不懂,请大家帮忙解析一下这个程序!
using System.Collections.Generic;
using System.Text;namespace zjlDoor
{
class Program
{
static void Main(string[] args)
{
Database db = new Database();
lll:
try
{
print();//adduser zjl 123
string command = Console.ReadLine();
string[] cmd = command.Split(new char[] { ' ' });
if (cmd[0].Equals("adduser"))
{
print();
if (db.not_sel("insert into t_user(userid,password) values('" + cmd[1] + "','" + cmd[2] + "')"))
Console.WriteLine("成功插入!");
else
Console.WriteLine("插入失败,手艺太潮!");
}
else if (cmd[0].Equals("addmoney"))
{
print();
if (db.not_sel("update t_user set account=account+" + cmd[2] + " where userid='" + cmd[1] + "'"))
Console.WriteLine("修改成功!");
else
Console.WriteLine("修改失败,手艺太潮!");
}
else if (cmd[0].Equals("quit"))
return;
else
Console.WriteLine("命令错误!");
goto lll;
}
catch (Exception ee) { Console.WriteLine(ee.Message); goto lll; }
}
private static void print()
{
Console.Write("zjl command line>>>");
}
}
}请各位大侠帮忙,这里的print()函数起什么作用啊?而且也没有参数,我是初学c#的,输出的时候没用过这个函数,请大家帮忙讲一下,还有就是那个lll:标识符的用法,我也不懂,请大家帮忙解析一下这个程序!
{
Console.Write("zjl command line>>>");
}没什么用,只是输出一段话而已: zjl command line>>>
10 x = input "Please select a function: press 0 exit:"
20 if x = 1 then 100
30 if x = 2 then 200
40 if x = 3 then 300
50 if x = 0 then 1000
60 goto 10
...
100 print "lets play a game"
...
200 print "lets listen to a music"
...
300 print "a tiny calc"
...
1000 end
zjl command line>>>你可以输入 adduser username password 来添加用户
输入 addmoney account userid 来添加钱
输入 quit 退出。就是这么回事,程序写的简直烂的难以接受。