Encoding.ASCII在Silverlight中不可用吗? [英] Encoding.ASCII not available in Silverlight is there a alternative?

查看:115
本文介绍了Encoding.ASCII在Silverlight中不可用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体应用程序的代码如下:

I have the following line of code for a Windows forms application:

return Encoding.ASCII.GetBytes(chars.ToArray());

此行运行正常,但今天我在Windows Phone / Silverlight框架上尝试了我的代码, :

This line worked fine, but today I was trying my code on the Windows Phone/Silverlight framework and the:

Encoding.ASCII 

库不存在。有没有(简单)的方式做同样的事情,但是使用Silverlight库?

Library does not exist there. Is there any (simple) way to do the same thing but with a Silverlight library?

推荐答案

尝试使用Encoding.UTF8 - Silverlight只是unicode。

Try using Encoding.UTF8 - Silverlight is unicode only.

这篇关于Encoding.ASCII在Silverlight中不可用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆