当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReader.ReadString方法代码示例

本文整理汇总了C#中BinaryReader.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadString方法的具体用法?C# BinaryReader.ReadString怎么用?C# BinaryReader.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryReader的用法示例。


在下文中一共展示了BinaryReader.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

    // 바이너리 로드
    public void Load()
    {
        FileStream fs = new FileStream("CharDB.bin", FileMode.Open);
        BinaryReader br = new BinaryReader(fs);

        // *주의
        // 바이너리 세이브 순서와 로드 순서가 같아야된다. [5/13/2012 JK]
        // 바이너리 리드
        int iCount = br.ReadInt32();        // 갯수 읽기
        for (int i = 0; i < iCount; ++i )
        {
            CCharInfo charInfo = new CCharInfo();

            charInfo.m_nCode = br.ReadInt32();          // 캐릭터 코드
            charInfo.m_strName = br.ReadString();       // 캐릭터 이름
            charInfo.m_strPrefab = br.ReadString();       // Assets 안에 있는 Prefab 텍스트명
            charInfo.m_nCharType = br.ReadInt32();      // 캐릭터 타입 0:플레이어 1:몬스터
            charInfo.m_nNowHP = br.ReadInt32();         // 현재 체력
            charInfo.m_nMaxHP = br.ReadInt32();         // 최대 체력
            charInfo.m_nCharWidth = br.ReadInt32();     // 캐릭터 넓이
            charInfo.m_fMoveSpeed = br.ReadSingle();    // 이동 속도(s) 목표지점까지 몇초만에 도착하는지
            charInfo.m_nAttackDamage = br.ReadInt32();  // 공격 데미지
            charInfo.m_nAttackRange = br.ReadInt32();   // 캐릭터 기본 사거리
            charInfo.m_fAttackSpeed = br.ReadSingle();  // 캐릭터 공격 속도 1: 1초에 한번
            charInfo.m_nExp = br.ReadInt32();           // 캐릭터가 죽었을시 제공되는 경험치
            charInfo.m_fAfterAttackIdleTermTime = br.ReadSingle(); // 공격후 Idle 유지 시간
            charInfo.m_nPay = br.ReadInt32();   // 보상(돈)
            m_mapCharacter.Add(charInfo.m_nCode, charInfo);
        }

        fs.Close();
        br.Close();
    }
开发者ID:ditto21c,项目名称:ExampleSource,代码行数:34,代码来源:CharacterDB.cs

示例2: ReadCollect

 public static void ReadCollect(string file)
 {
     Core.Collections.Clear();
     using (var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
     {
         var reader = new BinaryReader(fs);
         reader.ReadInt32(); //version
         int count = reader.ReadInt32();
         for (int i = 0; i < count; i++)
         {
             string title = reader.ReadString();
             int itemcount = reader.ReadInt32();
             var Nset = new List<int>();
             for (int j = 0; j < itemcount; j++)
             {
                 string md5 = reader.ReadString();
                 for (int k = 0; k < Core.allsets.Count; k++)
                 {
                     if (Core.allsets[k].md5.Contains(md5) && (!Nset.Contains(k)))
                     {
                         Nset.Add(k);
                     }
                 }
             }
             Core.Collections.Add(title, Nset);
         }
     }
 }
开发者ID:NitroP,项目名称:OSUplayer,代码行数:28,代码来源:OsuDB.cs

示例3: load

 public void load(BinaryReader buf)
 {
     _lasteState = buf.ReadBoolean();
     _nameObjectToHide = buf.ReadString();
     _strObjectToHide = buf.ReadString();
     //_objectToHide = transform.Find(_nameObjectToHide);
     _objectToHide = new List<Transform>();
     if(_objectToHide.Count==0)
     {
     //	_objectToHide = new List<Transform>();
     //	foreach (Transform child in transform)
         Transform[] allChildren = GetComponentsInChildren<Transform>();
         foreach (Transform child in allChildren)
         {
             if(_nameObjectToHide.CompareTo(_plageName)==0)
             {
                 if(child.name.Contains(_nameObjectToHide))
                     _objectToHide.Add(child);
                 if(child.name.Contains(_lowWallName))
                     _objectToHide.Add(child);
             }
             else
             {
                 if(child.name.Contains(_nameObjectToHide))
                     _objectToHide.Add(child);
             }
         }
         //_objectToHide = transform.Find(_nameObjectToHide);
     //	_lasteState = _hide;
     }
     DoAction();
 }
开发者ID:gviaud,项目名称:OS-unity-5,代码行数:32,代码来源:Function_hideObject.cs

示例4: load

 public void load(BinaryReader buf)
 {
     _lasteState = buf.ReadBoolean();
     _nameObjectToOpen = buf.ReadString();
     _nameObjectToClose = buf.ReadString();
     _strObjectToHide = buf.ReadString();
     _objectToClose = new List<Transform>();
     if(_objectToClose.Count==0)
     {
         Transform[] allChildren = GetComponentsInChildren<Transform>();
         foreach (Transform child in allChildren)
         {
             if(child.name.Contains(_nameObjectToClose))
                 _objectToClose.Add(child);
         }
     }
     _objectToOpen = new List<Transform>();
     if(_objectToOpen.Count==0)
     {
         Transform[] allChildren = GetComponentsInChildren<Transform>();
         foreach (Transform child in allChildren)
         {
             if(child.name.Contains(_nameObjectToOpen))
                 _objectToOpen.Add(child);
         }
     }
     DoAction();
 }
开发者ID:gviaud,项目名称:OS-unity-5,代码行数:28,代码来源:Function_openClose.cs

示例5: Read

 public void Read(BinaryReader r)
 {
     //if (r == null) throw new ArgumentNullException("r");
     FResult     = new StringBuilder(r.ReadString());
     FSeparator  = r.ReadString();
     FEmpty      = r.ReadBoolean();
 }
开发者ID:APouchkov,项目名称:ExtendedStoredProcedures,代码行数:7,代码来源:Strings.cs

示例6: Load

    // 바이너리 로드
    public void Load(TextAsset kTa_)
    {
        //FileStream fs = new FileStream("Assets\\Resources\\SkillDB.bytes", FileMode.Open);

        //BinaryReader br = new BinaryReader(fs);
        Stream kStream = new MemoryStream (kTa_.bytes);
        BinaryReader br = new BinaryReader(kStream);

        // *주의
        // 바이너리 세이브 순서와 로드 순서가 같아야된다. [5/13/2012 JK]
        // 바이너리 리드
        int iCount = br.ReadInt32();        // 갯수 읽기
        for (int i = 0; i < iCount; ++i)
        {
            StSkillInfo Info = new StSkillInfo();

            Info.m_nSkillCode = br.ReadInt32();               // 스킬 고유 코드
            Info.m_strName = br.ReadString();                // 스킬 이름
            Info.m_fRange = br.ReadSingle();                 // 스킬 적용 범위
            Info.m_nDamage = br.ReadInt32();            // 스킬 데미지량
            Info.m_nHeal = br.ReadInt32();              // 스킬 힐량
            Info.m_fContinueTime = br.ReadSingle();          // 스킬 적용되는 시간
            Info.m_strPrefab = br.ReadString();             // 스킬 사용시 사용할 Prefab

            m_tmSkill.Add(Info.m_nSkillCode, Info);
        }

        //fs.Close();
        br.Close();
        kStream.Close();
    }
开发者ID:ditto21c,项目名称:ExampleSource,代码行数:32,代码来源:SkillDB.cs

示例7: Load

    // 바이너리 로드
    public void Load()
    {
        FileStream fs = new FileStream("SkillDB.bin", FileMode.Open);
        BinaryReader br = new BinaryReader(fs);

        // *주의
        // 바이너리 세이브 순서와 로드 순서가 같아야된다. [5/13/2012 JK]
        // 바이너리 리드
        int iCount = br.ReadInt32();        // 갯수 읽기
        for (int i = 0; i < iCount; ++i)
        {
            CSkillInfo Info = new CSkillInfo();

            Info.m_nSkillCode = br.ReadInt32();               // 스킬 고유 코드
            Info.m_strName = br.ReadString();                // 스킬 이름
            Info.m_fRange = br.ReadSingle();                 // 스킬 적용 범위
            Info.m_nDamage = br.ReadInt32();            // 스킬 데미지량
            Info.m_nHeal = br.ReadInt32();              // 스킬 힐량
            Info.m_fContinueTime = br.ReadSingle();          // 스킬 적용되는 시간
            Info.m_strPrefab = br.ReadString();             // 스킬 사용시 사용할 Prefab

            m_tmSkill.Add(Info.m_nSkillCode, Info);
        }

        fs.Close();
        br.Close();
    }
开发者ID:ditto21c,项目名称:ExampleSource,代码行数:28,代码来源:SkillDB.cs

示例8: ReadObjectState

    public void ReadObjectState(BinaryReader binaryReader)
    {
        this.subString = binaryReader.ReadString();
        this.valueX = binaryReader.ReadInt32();
        this.valueB = binaryReader.ReadByte();

        this.gameObject.name = binaryReader.ReadString();
    }
开发者ID:niguerrac,项目名称:UnityUI,代码行数:8,代码来源:SimpleSubObject.cs

示例9: Read

 public void Read(BinaryReader r)
 {
     _delimiter = r.ReadString();
     int count = r.ReadInt32();
     _elements = new List<string>();
     for(int i=0; i < count; i++)
     {
         _elements.Add(r.ReadString());
     }
 }
开发者ID:ben-thul,项目名称:SQLCLR,代码行数:10,代码来源:Concatenate.cs

示例10: ReadVersionFile

 /// <summary>
 /// Reads the version file.
 /// </summary>
 public void ReadVersionFile()
 {
     if (File.Exists(Application.dataPath + TANGO_VERSION_DATA_PATH))
     {
         BinaryReader binaryReader = new BinaryReader(File.Open(Application.dataPath + TANGO_VERSION_DATA_PATH, FileMode.Open));
         m_versionTag = binaryReader.ReadString();
         m_gitHash = binaryReader.ReadString();
         m_branch = binaryReader.ReadString();
         m_validData = true;
     }
 }
开发者ID:ashomk,项目名称:beerpong,代码行数:14,代码来源:TangoSDKAbout.cs

示例11: GLNFS

 public GLNFS(Partition p)
 {
     this.a = p;
     byte[] array = new byte[512];
     this.a.ReadBlock(1uL, 1u, array);
     BinaryReader binaryReader = new BinaryReader(new MemoryStream(512));
     binaryReader.BaseStream.Data = array;
     if (!(binaryReader.ReadString() != "GFS SC"))
     {
         this.DriveLabel = binaryReader.ReadString();
     }
 }
开发者ID:Bargomer,项目名称:COSMOS-OS,代码行数:12,代码来源:GLNFS.cs

示例12: Load

    public void Load(Stream s)
    {
        BinaryReader br = new BinaryReader(s);
        int ver = br.ReadInt32();
		specialType = (BundleSpecialType)br.ReadInt32();
        option = (BundleOption)br.ReadInt32();
        int count = br.ReadInt32();
        deps = new DepInfo[count];

        for (int i = 0; i < count; i++)
        {
            deps[i].name = br.ReadString();
            deps[i].path = br.ReadString();
        }
    }
开发者ID:fengqk,项目名称:Art,代码行数:15,代码来源:AssetBundleHeader.cs

示例13: ReadBinary

    public void ReadBinary(BinaryReader reader)
    {
        maxHealth = reader.ReadInt32();
        maxMana = reader.ReadInt32();

        str = reader.ReadInt32();
        mag = reader.ReadInt32();
        dex = reader.ReadInt32();
        agi = reader.ReadInt32();
        def = reader.ReadInt32();

        weight = reader.ReadInt32();

        moveRange = reader.ReadInt32();
        moveSpeed = reader.ReadSingle();
        lobRange = reader.ReadInt32();

        string affStr = reader.ReadString();
        affinity = (AFFINITY) Enum.Parse(typeof(AFFINITY), affStr, true);

        soul = reader.ReadInt32();
        float cr = reader.ReadSingle();
        float cg = reader.ReadSingle();
        float cb = reader.ReadSingle();
        float ca = reader.ReadSingle();
        soulColor = new Color(cr, cg, cb, ca);
    }
开发者ID:cindyxu,项目名称:soulstrand,代码行数:27,代码来源:Character.cs

示例14: ReadFromFile

	public virtual SerializerResult ReadFromFile() {
		FileStream fileStream = File.OpenRead(fileName);
		BinaryReader readStream = new BinaryReader(fileStream);
		
		// Read the file header tag first and validate.
		string headerTag = readStream.ReadString();
		if (headerTag.Equals(fileHeaderTag) == false) {
			fileStream.Close();
			return SerializerResult.ErrorInvalidFileType;
		}
		
		// Read the saved file version.
		int fileVersion = readStream.ReadInt32();
		
		// Make sure we're not trying to read from a newer file version than our code currently supports.
		if (fileVersion > SerializerVersion) {
			fileStream.Close();
			return SerializerResult.ErrorNewerFileVersionNotSupported;
		}
		
		ReadFileData(fileVersion, readStream);

		fileStream.Close();
		
		return SerializerResult.Success;
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:26,代码来源:AbstractLevelSerializer.cs

示例15: Read

 public void Read(BinaryReader r) {
     strings =new List<string>();
     var str = r.ReadString();
     foreach (var s in str.Split('Ё')) {
         strings.Add(s);
     }
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:7,代码来源:concat.cs


注:本文中的BinaryReader.ReadString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。