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


C# Reader.ReadString方法代码示例

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


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

示例1: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ClanId = reader.ReadInt32();
			ClanName = reader.ReadString(Encoding.Unicode);
			LeaderName = reader.ReadString(Encoding.Unicode);
			ClanCrestId = reader.ReadInt32();
			ClanLevel = reader.ReadInt32();
			HasCastle = reader.ReadInt32() != 0;
			HasClanhall = reader.ReadInt32() != 0;
			reader.ReadInt32();
			CharLevel = reader.ReadInt32();
			reader.ReadInt32();
			reader.ReadInt32();
			AllyId = reader.ReadInt32();
			AllyName = reader.ReadString(Encoding.Unicode);
			AllyCrestId = reader.ReadInt32();
			InWar = reader.ReadInt32() != 0;

			int count = reader.ReadInt32();
			Members = new ClanMember[count];
			for (int i = 0; i < count; i++)
			{
				ClanMember Member = new ClanMember();
				Member.Name = reader.ReadString(Encoding.Unicode);
				Member.Level = reader.ReadInt32();
				Member.ClassId = reader.ReadInt32();
				reader.ReadInt32();
				reader.ReadInt32();
				Member.ObjectId = reader.ReadInt32();
				Members[i] = Member;
			}
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:35,代码来源:PledgeShowMemberListAll.cs

示例2: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ClanId = reader.ReadInt32();
			ClanName = reader.ReadString(Encoding.Unicode);
			AllyName = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:9,代码来源:PledgeInfo.cs

示例3: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			Type = (Lineage.Channel)reader.ReadInt32();
			Author = reader.ReadString(Encoding.Unicode);
			Message = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:10,代码来源:CreatureSay.cs

示例4: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			reader.ReadInt32();
			Sender = reader.ReadString(Encoding.Unicode);
			Receiver = reader.ReadString(Encoding.Unicode);
			Message = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:10,代码来源:FriendRecvMsg.cs

示例5: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			LeaderId = reader.ReadInt32();
			Loot = (Lineage.PartyLoot)reader.ReadInt32();
			Members = new Member[reader.ReadInt32()];
			for(int i = 0; i < Members.Length; i++)
			{
				Members[i] = new Member()
				{
					ObjectId = reader.ReadInt32(),
					Name = reader.ReadString(Encoding.Unicode),
					Cp = reader.ReadInt32(),
					MaxCp = reader.ReadInt32(),
					Hp = reader.ReadInt32(),
					MaxHp = reader.ReadInt32(),
					Mp = reader.ReadInt32(),
					MaxMp = reader.ReadInt32(),
					Level = reader.ReadInt32(),
					Class = reader.ReadInt32()
				};

				reader.ReadInt32();
				reader.ReadInt32();
			}
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:28,代码来源:PartySmallWindowAll.cs

示例6: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			MessageId = reader.ReadInt32();

			int count = reader.ReadInt32();
			Arguments = new KeyValuePair<type, object>[count];
			for (int i = 0; i < count; i++)
			{
				var key = (type)reader.ReadInt32();
				object value = null;
				switch (key)
				{
					case type.Text:
						value = reader.ReadString(Encoding.Unicode);
						break;
					case type.Number:
						value = reader.ReadInt32();
						break;
					case type.NpcName:
						value = reader.ReadInt32();
						break;
					case type.ItemName:
						value = reader.ReadInt32();
						break;
					case type.SkillName:
						value = reader.ReadInt32();
						reader.ReadInt32(); //there are 4 more bytes after this... the skill level by chance?
						break;
				}
				Arguments[i] = new KeyValuePair<type, object>(key, value);
			}
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:35,代码来源:SystemMessage.cs

示例7: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			MemberName = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:PartySmallWindowDelete.cs

示例8: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			MessageId = reader.ReadInt32();
			Content = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:NpcHtmlMessage.cs

示例9: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			LeaderName = reader.ReadString(Encoding.Unicode);
			PartyLoot = (Lineage.PartyLoot)reader.ReadInt32();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:AskJoinParty.cs

示例10: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id

			ObjectId = reader.ReadInt32();
			NpcId = reader.ReadInt32();
			IsAttackable = reader.ReadInt32() != 0;
			Position = new Library.Point(
				reader.ReadInt32(),
				reader.ReadInt32(),
				reader.ReadInt32());
			Heading = reader.ReadInt32();
				reader.ReadInt32();
			MAtkSpd = reader.ReadInt32();
			PAtkSpd = reader.ReadInt32();
			RunSpd = reader.ReadInt32();
			WalkSpd = reader.ReadInt32();
			SwimRunSpd = reader.ReadInt32();
			SwimWalkSpd = reader.ReadInt32();
			FlRunSpd = reader.ReadInt32();
			FlWalkSpd = reader.ReadInt32();
			FlyRunSpd = reader.ReadInt32();
			FlyWalkSpd = reader.ReadInt32();
			MoveSpdMult = reader.ReadDouble();
			AtkSpdMult = reader.ReadDouble();
			CollisionRadius = reader.ReadDouble();
			CollisionHeight = reader.ReadDouble();

			RightHand = reader.ReadInt32();
			BothHand = reader.ReadInt32();
			LeftHand = reader.ReadInt32();

			IsShowName = reader.ReadByte() != 0;
			IsRunning = reader.ReadByte() != 0;
			IsInCombat = reader.ReadByte() != 0;
			IsAlikeDead = reader.ReadByte() != 0;
			IsSummoned = reader.ReadByte() != 0;
			Name = reader.ReadString(Encoding.Unicode);
			Title = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:42,代码来源:NpcInfo.cs

示例11: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			Name = reader.ReadString(Encoding.Unicode);
			Cp = reader.ReadInt32();
			MaxCp = reader.ReadInt32();
			Hp = reader.ReadInt32();
			MaxHp = reader.ReadInt32();
			Mp = reader.ReadInt32();
			MaxMp = reader.ReadInt32();
			Level = reader.ReadInt32();
			Class = reader.ReadInt32();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:16,代码来源:PartySmallWindowUpdate.cs

示例12: Deserialise

 public override void Deserialise(Reader Reader)
 {
     Username = Reader.ReadString();
     ComputerName = Reader.ReadString();
 }
开发者ID:hnefatl,项目名称:Prototype1,代码行数:5,代码来源:ConnectMessage.cs

示例13: Deserialise

        protected override void Deserialise(Reader In)
        {
            // Deserialise base class then this class
            base.Deserialise(In);

            Title = In.ReadString();
            Department = new Department() { Id = In.ReadInt32() };
            Classes = Enumerable.Repeat(new Class(), In.ReadInt32()).ToList();
            Classes.ForEach(c => c.Id = In.ReadInt32());
            Email = In.ReadString();

            Bookings = Enumerable.Repeat(new Booking(), In.ReadInt32()).ToList();
            Bookings.ForEach(b => b.Id = In.ReadInt32());
        }
开发者ID:hnefatl,项目名称:Prototype1,代码行数:14,代码来源:Teacher.cs

示例14: ReadHeader

		public PackageHeader ReadHeader(Reader reader)
		{
			PackageHeader header = new PackageHeader();
			header.magic = reader.ReadBytes(0x04);
			Array.Reverse(header.magic);

			reader.Position = 0x07;
			header.pkg_type = reader.ReadByte();

			reader.Position = 0x08;
			header.pkg_info_offset = reader.ReadUInt32();

			reader.Position = 0x0C;
			header.pkg_info_count = reader.ReadUInt32();

			reader.Position = 0x10;
			header.header_size = reader.ReadUInt32();

			reader.Position = 0x14;
			header.item_count = reader.ReadUInt32();

			reader.Position = 0x18;
			header.total_size = reader.ReadUInt64();

			reader.Position = 0x20;
			header.data_offset = reader.ReadUInt64();

			reader.Position = 0x28;
			header.data_size = reader.ReadUInt64();

			reader.Position = 0x30;
			header.contentid = reader.ReadString(0x24);

			reader.Position = 0x60;
			header.digest = reader.ReadBytes(0x10);
			Array.Reverse(header.digest);

			reader.Position = 0x70;
			header.pkg_data_riv = reader.ReadBytes(0x10);
			Array.Reverse(header.pkg_data_riv);

			reader.Position = 0x80;
			header.header_cmac_hash = reader.ReadBytes(0x10);
			Array.Reverse(header.header_cmac_hash);

			reader.Position = 0x90;
			header.header_npdrm_signature = reader.ReadBytes(0x28);
			Array.Reverse(header.header_npdrm_signature);

			reader.Position = 0xB8;
			header.header_sha1_hash = reader.ReadBytes(0x08);
			Array.Reverse(header.header_sha1_hash);

			return header;
		}
开发者ID:lockflatboy,项目名称:PlayStationStorePackage,代码行数:55,代码来源:PackageExtra.cs

示例15: ScanSlots

        private void ScanSlots()
        {
            int[] offsets =
            {
                0xE35800,
                0xE35830,
                0xE35850
            };
            Slots = new List<Slot>();
            using (var reader = new Reader(buffer, true))
            {
                var constructor = new StringBuilder();
                for (int i = 0; i < 30; i++)
                {
                    SetStatus("Scanning Slot#" + (i + 1).ToString(CultureInfo.InvariantCulture));

                    //Pre-scan for name entries to map 'empty' slots. This accomodates foreign languages.
                    reader.Position = 0xE35850 + (128 * i);
                    if (reader.ReadInt8() == 0) continue;

                    constructor.Append("Slot#" + (i + 1));
                    //Get Locale, Time & Name
                    for (int o = 0; o < 3; o++)
                    {
                        constructor.Append(", ");
                        reader.Position = offsets[o] + (128 * i);
                        constructor.Append(reader.ReadString(StringType.Ascii, 16).Replace("\0", ""));
                        // .Trim(Convert.ToChar("\0")));
                    }

                    ////Build List

                    //SaveSlot.Items.Add(constructor.ToString());
                    Slots.Add(new Slot
                              {
                                  SlotString = constructor.ToString(),
                                  StartingOffset = 0x44 + (0x79400 * (i + 1)),
                                  SlotID = i
                              });
                    constructor.Clear();
                }
                //TODO Add flag for failed load, reset editor state.
                if (Slots.Count == 0)
                {
                    //If no slots are used, editing is pointless since there's nothing to work with.
                    MessageBox.Show(
                        "This save appears to be empty!\nIf this save does contain a used slot, an error has occurred.\nEither way, aborting load operation.",
                        "Error!", MessageBoxButton.OK,
                        MessageBoxImage.Exclamation);
                    return;
                }
                //Load first valid slot
                SaveSlot.Items.Clear();
                foreach (Slot slot in Slots)
                {
                    var item = new ComboBoxItem { Tag = slot.SlotID, Content = slot.SlotString };
                    SaveSlot.Items.Add(item);
                }
                SaveSlot.Items.Refresh();
                SaveSlot.SelectedIndex = 0;
                SaveSlot.SelectionChanged += SetIndex;
                LoadSlot();
            }
        }
开发者ID:8Ball360Haven,项目名称:BladestormSaveEditor,代码行数:64,代码来源:MainWindow.xaml.cs


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