开发者

Converting a list of encodings to some sort of array in vb.net?

I want to loop through all the items in the items, but first I must to cast to appropriate type which I fail.

'  Dim arr As EncodingInfo 
   开发者_开发技巧     Dim arr As List(Of Encoding) = DirectCast(System.Text.Encoding.GetEncodings(), List(Of Encoding))
        ' Error 1   Value of type '1-dimensional array of System.Text.EncodingInfo' 
        '  cannot be converted to 'System.Collections.Generic.List(Of System.Text.Encoding)'.   


something like:

Dim arr As List(Of Text.EncodingInfo) = System.Text.Encoding.GetEncodings().ToList 

should work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜