本文整理汇总了C#中Deserializer.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# Deserializer.GetString方法的具体用法?C# Deserializer.GetString怎么用?C# Deserializer.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deserializer
的用法示例。
在下文中一共展示了Deserializer.GetString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadCookies
public void LoadCookies(byte[] data)
{
_cookies = new CookieContainer();
Deserializer deserializer = new Deserializer(data);
int count = deserializer.GetInt();
for (int i = 0; i < count; ++i)
{
string name = deserializer.GetString();
string value = deserializer.GetString();
string path = deserializer.GetString();
string domain = deserializer.GetString();
Cookie cookie = new Cookie(name, value, path, domain);
_cookies.Add(cookie);
}
}
示例2: LoadNamespaces
public void LoadNamespaces(IEnumerable<byte> data)
{
_namespaces.Clear();
Deserializer deserializer = new Deserializer(data);
int count = deserializer.GetInt();
for (int i = 0; i < count; ++i)
{
string ns = deserializer.GetString();
int number = deserializer.GetInt();
_namespaces.Add(ns, number);
}
}
示例3: SwitchToLanguage
public static void SwitchToLanguage(string language)
{
_namespaces.Clear();
_reversedNamespaces.Clear();
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
path += @"\WikiLive\" + language;
Deserializer deserializer = new Deserializer(File.ReadAllBytes(path + @"\namespaces.dat"));
int count = deserializer.GetInt();
for (int i = 0; i < count; ++i)
{
int number;
int.TryParse(deserializer.GetString(), out number);
_namespaces.Add(deserializer.GetString(), number);
}
foreach (KeyValuePair<string, int> pair in _namespaces)
{
_reversedNamespaces.Add(pair.Value, pair.Key);
}
}