本文介绍了对于“XDevkit.IXboxDebugTarget.GetMemory(UINT,UINT的byte [],出UINT)”的最佳重载的方法匹配具有一些无效参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误可以发现下面的code!

Errors Can Be Found Underneath the Code!

底座code:

XDevkit.IXboxDebugTarget.GetMemory(uint, uint, byte[], out uint)

我有哪些

        uint num1;
        uint num2;
        uint num4;


        num1 = Convert.ToUInt32(textBox2.Text);
        num2 = Convert.ToUInt32(textBox3.Text);
        num4 = Convert.ToUInt32(textBox5.Text);
        byte[] num3;
        num3 = BitConverter.GetBytes(Convert.ToInt32(textBox3.Text));


        IXboxManager xbm = new XboxManager();
        IXboxConsole xbc = xbm.OpenConsole("textBox1.Text"); //Or Console Name in "" 
        IXboxDebugTarget xdt = xbc.DebugTarget;
        xdt.ConnectAsDebugger("XeDevMemPatcher", XboxDebugConnectFlags.Force); // this isn't always needed 
        IXboxDebugTarget.GetMemory(num1, num2, num3, out num4);

    }

错误

1)的名称编码并没有在当前上下文中存在

1) The name 'Encoding' does not exist in the current context

2)'XDevkit.IXboxDebugTarget.GetMemory(UINT,UINT的byte [],出UINT)的最佳重载的方法匹配具有一些无效参数

2) The best overloaded method match for 'XDevkit.IXboxDebugTarget.GetMemory(uint, uint, byte[], out uint)' has some invalid arguments

3)参数3:无法从字节转换为字节[]

3) Argument 3: cannot convert from 'byte' to 'byte[]'

来源:

使用系统;
使用System.Windows.Forms的;

using System;using System.Windows.Forms;

命名空间XDevkit
{
    公共部分Form1类:表格
    {
        公共Form1中()
        {
            的InitializeComponent();
        }

namespace XDevkit{ public partial class Form1 : Form { public Form1() { InitializeComponent(); }

    private void button1_Click(object sender, EventArgs e)
    {
        IXboxManager xbm = new XboxManager();
        //IXboxConsole xbc = xbm.OpenConsole(xbm.DefaultConsole); // dev 
        IXboxConsole xbc = xbm.OpenConsole("textBox1.Text");
        IXboxDebugTarget xdt = xbc.DebugTarget;
        xdt.ConnectAsDebugger("XeDevMemPatcher", XboxDebugConnectFlags.Force);

    }

    private void button2_Click(object sender, EventArgs e)
    {
    uint num1 = Convert.ToUInt32(textBox2.Text);
    uint num2 = Convert.ToUInt32(textBox3.Text);
    byte[] num3 = Encoding.ASCII.GetBytes(textBox4.Text);
    uint num4 = Convert.ToUInt32(textBox5.Text);
    int num5 = Convert.ToInt32(textBox4.Text);

// ...

    if (num3.Length > 1) 
    {    
        IXboxManager xbm = new XboxManager();
        IXboxConsole xbc = xbm.OpenConsole("textBox1.Text");
        IXboxDebugTarget xdt = xbc.DebugTarget;
        xdt.ConnectAsDebugger("XeDevMemPatcher", XboxDebugConnectFlags.Force);
        IXboxDebugTarget.GetMemory(num1, num2, num3, out num4);
}

    private void button3_Click(object sender, EventArgs e)
    {
        string a;
        a = "textBox6.Text";

        IXboxManager xbm = new XboxManager();
        IXboxConsole xbc = xbm.OpenConsole(textBox1.Text);
        IXboxConsole.ScreenShot(a)

    }
}

}

推荐答案

由于第三个参数GetMemory期待一个字节数组,你NUM3变量是一个字节数组,你应该只把它作为 NUM3

Since the third argument to GetMemory is expecting a byte array, and your num3 variable is a byte array, you should just pass it as num3

对于编码在目前情况下不存在,你很可能只是缺少使用System.Text

As for Encoding not existing in the current context, you are likely just missing using System.Text

这篇关于对于“XDevkit.IXboxDebugTarget.GetMemory(UINT,UINT的byte [],出UINT)”的最佳重载的方法匹配具有一些无效参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 10:22