错误:system.console.write(string)是一个方法,但是类似于一个类型 [英] error: system.console.write (string) is a method but like a type

查看:69
本文介绍了错误:system.console.write(string)是一个方法,但是类似于一个类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用System;

使用System.Collections.Generic;

使用System.Linq;

使用System.Text;

使用System.Threading.Tasks;

名称空间方法

{

   课程计划

    {

        static void showMessage(string Param);

        {

        Console.Write("Hello Mr:"+ Param);

        }¥b $ b        static void Main(string [] args)

        {

            showMessage(" Khalid");

            console.readkey();

        }¥b $ b    }
}

解决方案

删除第六个';'并更改为'Console.ReadKey'。


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Methods
{
    class Program
    {
        static void showMessage(string Param);
        {
        Console.Write("Hello Mr: "+ Param);
        }
        static void Main(string[] args)
        {
            showMessage("Khalid");
            console.readkey();
        }
    }
}

解决方案

Remove the sixth ‘;’ and also change to ‘Console.ReadKey’.


这篇关于错误:system.console.write(string)是一个方法,但是类似于一个类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆