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:标识符的用法,我也不懂,请大家帮忙解析一下这个程序!

解决方案 »

  1.   

     private static void print()
      {
      Console.Write("zjl command line>>>");
      }没什么用,只是输出一段话而已:  zjl command line>>>
      

  2.   

    记得在我上小学二年级刚学BASIC的时候,因为不会循环语句,所以使用GOTO代替循环:比如
    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
      

  3.   

    你的程序,不知道为什么要用 goto,作者是小学生么?其实它就是不断循环,接受一个命令,然后做对应的操作。不断输出:
    zjl command line>>>你可以输入 adduser username password 来添加用户
    输入 addmoney account userid 来添加钱
    输入 quit 退出。就是这么回事,程序写的简直烂的难以接受。 
      

  4.   

    还是不明白,我想问的是print()有什么用,去掉后会是什么结果!
      

  5.   

    天啊,明白了,学晕了,c#里原来没有print函数,我一直理解成自带的函数了,见笑了!呵呵!