the convertion between string and BlobColumn

时间:2021-08-30 06:45:59

It's hard to find some samples about the convertion between string and BlobColumn.AddBlobData.

It's 太坑人了

1.convert  BlobColumn to string.  (Get user name from  BlobColumn type data)

  

    public override void Input0_ProcessInputRow(Input0Buffer Row)
{
string userName = Encoding.Unicode.GetString(Row.UserName.GetBlobData(, Convert.ToInt32(Row.UserName.Length)));
}
 

2. Convert string to  BlobColumn. (add user name to BlobColumn type)

  

    public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.Out_UserName.AddBlobData(Encoding.Unicode.GetBytes(UserName)); }
alert("不用谢,记得我叫迎风一刀劈就行了");