本文整理汇总了C#中TextReader.ReadToEnd方法的典型用法代码示例。如果您正苦于以下问题:C# TextReader.ReadToEnd方法的具体用法?C# TextReader.ReadToEnd怎么用?C# TextReader.ReadToEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextReader
的用法示例。
在下文中一共展示了TextReader.ReadToEnd方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public static TextTable Parse(TextReader reader)
{
TextTable table = new TextTable();
if (regularExpressionParser == null)
loadRegEx ();
string tableString = reader.ReadToEnd ();
MatchCollection matches = regularExpressionParser.Matches (tableString);
foreach (Match m in matches)
{
if(!m.Success)
{
string logError = "Error: Could not parse string in file matching \"" + m.Value + "\"";
Debug.LogError(logError);
return null;
}
string key = m.Groups["tag"].Value;
Group group = m.Groups["text"];
string s = "";
foreach(Capture c in group.Captures)
{
s += c.Value + "\n";
}
if(s.Length > 0)
s = s.Substring(0, s.Length - 1);
table.AddEntry(key, s);
}
return table;
}
示例2: Run
/// <summary>
/// Runs a set of JavaScript statements and optionally returns a value if return is called
/// </summary>
/// <param name="reader">The TextReader to read script from</param>
/// <param name="unwrap">Whether to unwrap the returned value to a CLR instance. <value>True</value> by default.</param>
/// <returns>Optionaly, returns a value from the scripts</returns>
/// <exception cref="System.ArgumentException" />
/// <exception cref="System.Security.SecurityException" />
/// <exception cref="Jint.JintException" />
public object Run(TextReader reader, bool unwrap)
{
return Run(reader.ReadToEnd(), unwrap);
}
示例3: LoadFromTextReader
public static string LoadFromTextReader(TextReader sr)
{
var fileContent = sr.ReadToEnd ();
return fileContent;
}
示例4: ReadText
static void ReadText(TextReader textReader)
{
JsonData data = JsonMapper.ToObject(textReader.ReadToEnd());
CardDlg_SysPassword[0] = data["CardDlg"]["strSysPassword"][0].ToString();
CardDlg_SysPassword[1] = data["CardDlg"]["strSysPassword"][1].ToString();
}
示例5: Scanner
public Scanner(TextReader reader)
{
result = new List<Token>();
string source = reader.ReadToEnd();
Scan(source);
}