Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.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# 类的动态对象反序列化_C#_Json_Json.net_Deserialization - Fatal编程技术网

C# 类的动态对象反序列化

C# 类的动态对象反序列化,c#,json,json.net,deserialization,C#,Json,Json.net,Deserialization,所以这在过去一两天一直困扰着我,我就是不明白为什么会这样 目前,我正在尝试将动态对象反序列化到类中以供使用。但是由于某种原因,我收到了这个错误:(我的类)有一些无效的参数。我用于反序列化的代码: dynamic BaseOffsets = JsonConvert.DeserializeObject(File.ReadAllText(Environment.CurrentDirectory + @"\Offsets.json")); Netvars = JsonConver

所以这在过去一两天一直困扰着我,我就是不明白为什么会这样

目前,我正在尝试将动态对象反序列化到类中以供使用。但是由于某种原因,我收到了这个错误:(我的类)有一些无效的参数。我用于反序列化的代码:

dynamic BaseOffsets = JsonConvert.DeserializeObject(File.ReadAllText(Environment.CurrentDirectory + @"\Offsets.json"));
            Netvars = JsonConvert.DeserializeObject<netvars>(BaseOffsets.netvars);
            Signatures = JsonConvert.DeserializeObject<signatures>(BaseOffsets.signatures);

如果有人能帮助我,我将不胜感激,我已经搜索了几个小时,但我仍然是一个难解之谜。

修复了我的问题,只需反序列化主类,然后取出两个子类。这不是我想要的,但它是有效的

通常,这个错误伴随着一个或两个其他的错误,告诉你细节。您可以发布其他错误消息吗?
public class netvars
{
    public Int32 m_ArmorValue { get; set; }
    public Int32 m_Collision { get; set; }
    public Int32 m_CollisionGroup { get; set; }
    public Int32 m_Local { get; set; }
    public Int32 m_MoveType { get; set; }
    public Int32 m_OriginalOwnerXuidHigh { get; set; }
    public Int32 m_OriginalOwnerXuidLow { get; set; }
    public Int32 m_aimPunchAngle { get; set; }
    public Int32 m_aimPunchAngleVel { get; set; }
    public Int32 m_bGunGameImmunity { get; set; }
    public Int32 m_bHasDefuser { get; set; }
    public Int32 m_bHasHelmet { get; set; }
    public Int32 m_bInReload { get; set; }
    public Int32 m_bIsDefusing { get; set; }
    public Int32 m_bIsScoped { get; set; }
    public Int32 m_bSpotted { get; set; }
    public Int32 m_bSpottedByMask { get; set; }
    public Int32 m_clrRender { get; set; }
    public Int32 m_dwBoneMatrix { get; set; }
    public Int32 m_fAccuracyPenalty { get; set; }
    public Int32 m_fFlags { get; set; }
    public Int32 m_flFallbackWear { get; set; }
    public Int32 m_flFlashDuration { get; set; }
    public Int32 m_flFlashMaxAlpha { get; set; }
    public Int32 m_flNextPrimaryAttack { get; set; }
    public Int32 m_hActiveWeapon { get; set; }
    public Int32 m_hMyWeapons { get; set; }
    public Int32 m_hObserverTarget { get; set; }
    public Int32 m_hOwner { get; set; }
    public Int32 m_hOwnerEntity { get; set; }
    public Int32 m_iAccountID { get; set; }
    public Int32 m_iClip1 { get; set; }
    public Int32 m_iCompetitiveRanking { get; set; }
    public Int32 m_iCompetitiveWins { get; set; }
    public Int32 m_iCrosshairId { get; set; }
    public Int32 m_iEntityQuality { get; set; }
    public Int32 m_iFOVStart { get; set; }
    public Int32 m_iGlowIndex { get; set; }
    public Int32 m_iHealth { get; set; }
    public Int32 m_iItemDefinitionIndex { get; set; }
    public Int32 m_iItemIDHigh { get; set; }
    public Int32 m_iObserverMode { get; set; }
    public Int32 m_iShotsFired { get; set; }
    public Int32 m_iState { get; set; }
    public Int32 m_iTeamNum { get; set; }
    public Int32 m_lifeState { get; set; }
    public Int32 m_nFallbackPaintKit { get; set; }
    public Int32 m_nFallbackSeed { get; set; }
    public Int32 m_nFallbackStatTrak { get; set; }
    public Int32 m_nForceBone { get; set; }
    public Int32 m_nTickBase { get; set; }
    public Int32 m_rgflCoordinateFrame { get; set; }
    public Int32 m_szCustomName { get; set; }
    public Int32 m_szLastPlaceName { get; set; }
    public Int32 m_thirdPersonViewAngles { get; set; }
    public Int32 m_vecOrigin { get; set; }
    public Int32 m_vecVelocity { get; set; }
    public Int32 m_vecViewOffset { get; set; }
    public Int32 m_viewPunchAngle { get; set; }
}

public class signatures
{
    public Int32 dwClientState { get; set; }
    public Int32 dwClientState_GetLocalPlayer { get; set; }
    public Int32 dwClientState_IsHLTV { get; set; }
    public Int32 dwClientState_Map { get; set; }
    public Int32 dwClientState_MapDirectory { get; set; }
    public Int32 dwClientState_MaxPlayer { get; set; }
    public Int32 dwClientState_PlayerInfo { get; set; }
    public Int32 dwClientState_State { get; set; }
    public Int32 dwClientState_ViewAngles { get; set; }
    public Int32 dwEntityList { get; set; }
    public Int32 dwForceAttack { get; set; }
    public Int32 dwForceAttack2 { get; set; }
    public Int32 dwForceBackward { get; set; }
    public Int32 dwForceForward { get; set; }
    public Int32 dwForceJump { get; set; }
    public Int32 dwForceLeft { get; set; }
    public Int32 dwForceRight { get; set; }
    public Int32 dwGameDir { get; set; }
    public Int32 dwGameRulesProxy { get; set; }
    public Int32 dwGetAllClasses { get; set; }
    public Int32 dwGlobalVars { get; set; }
    public Int32 dwGlowObjectManager { get; set; }
    public Int32 dwInput { get; set; }
    public Int32 dwInterfaceLinkList { get; set; }
    public Int32 dwLocalPlayer { get; set; }
    public Int32 dwMouseEnable { get; set; }
    public Int32 dwMouseEnablePtr { get; set; }
    public Int32 dwPlayerResource { get; set; }
    public Int32 dwRadarBase { get; set; }
    public Int32 dwSensitivity { get; set; }
    public Int32 dwSensitivityPtr { get; set; }
    public Int32 dwSetClanTag { get; set; }
    public Int32 dwViewMatrix { get; set; }
    public Int32 dwWeaponTable { get; set; }
    public Int32 dwWeaponTableIndex { get; set; }
    public Int32 dwYawPtr { get; set; }
    public Int32 dwZoomSensitivityRatioPtr { get; set; }
    public Int32 dwbSendPackets { get; set; }
    public Int32 dwppDirect3DDevice9 { get; set; }
    public Int32 m_pStudioHdr { get; set; }
    public Int32 m_pitchClassPtr { get; set; }
    public Int32 m_yawClassPtr { get; set; }
}