本文整理汇总了C#中System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding方法的典型用法代码示例。如果您正苦于以下问题:C# TdsParserStateObject.ReadStringWithEncoding方法的具体用法?C# TdsParserStateObject.ReadStringWithEncoding怎么用?C# TdsParserStateObject.ReadStringWithEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.TdsParserStateObject
的用法示例。
在下文中一共展示了TdsParserStateObject.ReadStringWithEncoding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadSqlStringValue
private void ReadSqlStringValue(SqlBuffer value, byte type, int length, Encoding encoding, bool isPlp, TdsParserStateObject stateObj)
{
string strEmpty;
byte num = type;
if (num <= 0x63)
{
if (num > 0x27)
{
switch (num)
{
case 0x2f:
goto Label_004C;
case 0x63:
goto Label_006B;
}
return;
}
if ((num != 0x23) && (num != 0x27))
{
return;
}
}
else if (num <= 0xaf)
{
if ((num != 0xa7) && (num != 0xaf))
{
return;
}
}
else
{
switch (num)
{
case 0xe7:
case 0xef:
goto Label_006B;
}
return;
}
Label_004C:
if (encoding == null)
{
encoding = this._defaultEncoding;
}
value.SetToString(stateObj.ReadStringWithEncoding(length, encoding, isPlp));
return;
Label_006B:
strEmpty = null;
if (isPlp)
{
char[] buff = null;
length = this.ReadPlpUnicodeChars(ref buff, 0, length >> 1, stateObj);
if (length > 0)
{
strEmpty = new string(buff, 0, length);
}
else
{
strEmpty = ADP.StrEmpty;
}
}
else
{
strEmpty = stateObj.ReadString(length >> 1);
}
value.SetToString(strEmpty);
}