代码中有什么错误? [英] What error is there in the code?

查看:58
本文介绍了代码中有什么错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 private void open(string a)
                {
                    ProcessStartInfo theProcess = new ProcessStartInfo(a);

                    theProcess.WindowStyle = ProcessWindowStyle.Normal;

                    Process.Start(theProcess);
                    

                }


我得到一个错误

"修饰符'private'对此项目无效"

"The modifier 'private' is not valid for this item"

程序中存在什么错误.

需要帮助

推荐答案

我看不到该方法本身有什么问题.例如,以下对我有用(假设"say"和"finished_action"也是该类中的方法):

I can't see anything wrong with that method on its own. For example, the following works for me (assuming that "say" and "finished_action" are also methods within the class):

class MyClass
{
    private void open(string a)
    {
        ProcessStartInfo theProcess = new ProcessStartInfo(a);

        theProcess.WindowStyle = ProcessWindowStyle.Normal;

        Process.Start(theProcess);
        
        say(finished_action());
    }
}

问题可能出在您试图放置该方法的位置,因此您可能需要给我们更多的上下文(例如,更多示例,例如周围的类代码等).

The issue may be where you are trying to put the method, so you may need to give us some more context (i.e. more of an example such as some of the surrounding class code etc).


这篇关于代码中有什么错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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