代码改变世界

orcle blob转换

2010-09-27 11:11  cnb_mtime  阅读(297)  评论(0编辑  收藏  举报

    public static string BlobToString(Object blob)
    {
        string _str = "";
        if (blob != null)
        {
            byte[] _ff = (byte[])(blob);
            _str = System.Text.Encoding.Unicode.GetString(_ff);
        }
        return _str;
    }

    public static byte[] StringToBlob(string _str) 
    {
        byte[] expbyte = System.Text.Encoding.Unicode.GetBytes(_str);
        return expbyte;
    }