C# BitConverter error

本文关键字:error BitConverter | 更新日期: 2023-09-27 18:02:33

当我尝试启动我的c#程序时,我得到了一个错误(请不要我不是很好的编程,所以如果你能以非常简单的方式写出答案,那将不胜感激)

byte[] buffer = BitConverter.GetBytes(Convert.ToInt32(value));                
PS3.SetMemory(offset, buffer);

这里是错误的图片- http://prntscr.com/7s2uq9

错误读取"类型或名称空间名称'GetBytes'在名称空间'BitConverter'中不存在(您是否缺少程序集引用?)"

我已经试过这些
-重写代码
重写顶部的命名空间引用(http://prntscr.com/7s2vf6)

我的"using Reference things are" -

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using PS3Lib;
using MetroFramework.Forms;
using MetroFramework;
using SimdiBo2;

C# BitConverter error

名称空间BitConverter混淆了编译器。要么重命名本地名称空间,要么使用类的完全限定名:

System.BitConverter.GetBytes(...);