Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# adb shell,我怎样才能从这里得到请求?_C#_.net - Fatal编程技术网

C# adb shell,我怎样才能从这里得到请求?

C# adb shell,我怎样才能从这里得到请求?,c#,.net,C#,.net,我正在尝试制作一个程序,只检查手机是否有根。为此,我必须通过cmd发送adb shellsu,但问题是我的文本框没有得到任何输出来检查结果。。 这是我的密码: public string root_checker { get { psi.Arguments = "shell su"; Process call = Process.Start(psi); StreamReader sr

我正在尝试制作一个程序,只检查手机是否有根。为此,我必须通过cmd发送adb shell
su
,但问题是我的文本框没有得到任何输出来检查结果。。 这是我的密码:

public string root_checker
    {
        get
        {
            psi.Arguments = "shell su";
            Process call = Process.Start(psi);
            StreamReader sr = call.StandardOutput;
            string output = sr.ReadToEnd();
            return output;
        }


    }
这是一个在按钮:

private void button2_Click_1(object sender, EventArgs e)
        {
            string shell = adb.root_checker;
            textBox1.Text = shell;
        }
我的程序没有响应,什么也没发生。我在网上搜索了很多东西,但没有得到任何有用的东西


谢谢

getter
应该返回值。这不会编译。你确定这是实际代码吗?另外,
StreamReader
是一次性的。您应该将其处理为清理未管理的资源。对不起,我的错误,请立即更正帖子。。