如果您想了解silverlight–如何在WindowsPhone7中提取zip文件?的相关知识,那么本文是一篇不可错过的文章,我们将对7zip怎么提取文件进行全面详尽的解释,并且为您提供关于c#–如
如果您想了解silverlight – 如何在Windows Phone 7中提取zip文件?的相关知识,那么本文是一篇不可错过的文章,我们将对7zip怎么提取文件进行全面详尽的解释,并且为您提供关于c# – 如何在Windows Phone 7中以编程方式创建ListBox.Itemtemplate,datatemplate、c# – 如何在Windows Phone 7应用程序中以脱机模式从Web查看图像、c# – 如何在Windows Phone 8.1 Runtime中获取连接和操作符信息、c# – 如何在Windows Phone 8.1(通用应用程序)中确定我是连接到WiFi还是移动网络?的有价值的信息。
本文目录一览:- silverlight – 如何在Windows Phone 7中提取zip文件?(7zip怎么提取文件)
- c# – 如何在Windows Phone 7中以编程方式创建ListBox.Itemtemplate,datatemplate
- c# – 如何在Windows Phone 7应用程序中以脱机模式从Web查看图像
- c# – 如何在Windows Phone 8.1 Runtime中获取连接和操作符信息
- c# – 如何在Windows Phone 8.1(通用应用程序)中确定我是连接到WiFi还是移动网络?
silverlight – 如何在Windows Phone 7中提取zip文件?(7zip怎么提取文件)
Stream stremInfo = Application.GetResourceStream(new Uri("xip.zip",UriKind.Relative)).Stream; new FastZip(). ExtractZip(stremInfo,"",FastZip.Overwrite.Always,null,true,true);
但是,在调用ExractZip时出现错误.我得到的例外是“MethodAccessException”.无法调用GetFullPath().任何人都可以让我知道我错过了什么?我该怎么做才能避免它?
解决方法
http://www.sharpgis.net/post/2009/04/22/REALLY-small-unzip-utility-for-Silverlight.aspx
c# – 如何在Windows Phone 7中以编程方式创建ListBox.Itemtemplate,datatemplate
有没有办法以编程方式创建数据模板?
这是XAML代码,但我需要在代码中使用c#而不是XAML,因为
我正在创建动态列表框,添加itemtemplatem,datatemplate
<ListBox Height="520" HorizontalAlignment="Left" Margin="0,6,0" Name="lstimge" VerticalAlignment="Top" Width="450" > <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image Source="{Binding Image}" Width="150" Stretch="Uniform" HorizontalAlignment="Center" /> <TextBlock Text="{Binding FileName}" textwrapping="Wrap" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
请给出解决方案
谢谢,
阿肖克
解决方法
如果您在代码中动态生成模板XAML,则可以按照here所述加载它.
我怀疑如果沿着这条路走下去,你会发现自己会打开一大堆蠕虫.作为替代方案,您可以预定义一组模板,并在运行时动态选择正确的模板,如here所述
c# – 如何在Windows Phone 7应用程序中以脱机模式从Web查看图像
<Button Click="Image_Click" Name="image1" Margin="-33,-16,-26,-13"> <Button.Background> <ImageBrush Stretch="Fill" ImageSource="http://political-leader.vzons.com/ArvindKejriwal/images/icons/landing.png"/> </Button.Background> </Button>
这是一个可点击的图像,单击该图像导航到另一个页面.
现在,当图像来自网络时,我希望下次即使在离线模式下也可以查看此图像.任何人都可以帮我如何做到这一点
解决方法
当我自己面对问题时,我用硬/手动的方式做了 – 自己下载图像,将它们缓存在文件系统上并从那里引用它们.建议的答案似乎提供了一种更简单的方法.
编辑:这个问题与Windows Phone 8有关,但看起来它适用于Windows Phone 7.5(也称为Mango).不知道7,但你应该以7.5为目标(没有无法升级到7.5的手机)
c# – 如何在Windows Phone 8.1 Runtime中获取连接和操作符信息
我需要的是Devicenetworkinformation来获取连接到互联网的设备是什么类型的NetworkInterfaceType.
Windows Phone 8.0中的示例代码.
public void GetDeviceConnectionInfo() { Devicenetworkinformation.ResolveHostNameAsync(new DnsEndPoint("microsoft.com",80),nrr => { NetworkInterfaceInfo info = nrr.NetworkInterface; if (info != null) { switch (info.InterfaceType) { case NetworkInterfaceType.Ethernet: // Do something break; case NetworkInterfaceType.MobilebroadbandCdma: case NetworkInterfaceType.MobilebroadbandGsm: switch (info.InterfaceSubtype) { case NetworkInterfaceSubType.Cellular_3G: case NetworkInterfaceSubType.Cellular_EVDO: case NetworkInterfaceSubType.Cellular_EVDV: case NetworkInterfaceSubType.Cellular_HSPA: // Do something break; } // Do something break; case NetworkInterfaceType.Wireless80211: // Do something break; } } },null); }
您可以使用Devicenetworkinformation.CellularMobileOperator访问操作符的名称.
解决方法
我不建议使用IanaInterfaceType,InboundMaxBitsPerSecond或OutboundMaxBitsPerSecond来确定连接类型,因为它们非常不准确.
以下方法获取WP中状态栏中显示的连接类型.请注意,连接模式不一定表示上传/下载速度!
using Windows.Networking.Connectivity; /// <summary> /// Detect the current connection type /// </summary> /// <returns> /// 2 for 2G,3 for 3G,4 for 4G /// 100 for WiFi /// 0 for unkNown or not connected</returns> private static byte GetConnectionGeneration() { ConnectionProfile profile = networkinformation.GetInternetConnectionProfile(); if (profile.IsWwanConnectionProfile) { WwanDataClass connectionClass = profile.WwanConnectionProfileDetails.GetCurrentDataClass(); switch (connectionClass) { //2G-equivalent case WwanDataClass.Edge: case WwanDataClass.Gprs: return 2; //3G-equivalent case WwanDataClass.Cdma1xEvdo: case WwanDataClass.Cdma1xEvdoRevA: case WwanDataClass.Cdma1xEvdoRevB: case WwanDataClass.Cdma1xEvdv: case WwanDataClass.Cdma1xRtt: case WwanDataClass.Cdma3xRtt: case WwanDataClass.CdmaUmb: case WwanDataClass.umts: case WwanDataClass.Hsdpa: case WwanDataClass.Hsupa: return 3; //4G-equivalent case WwanDataClass.LteAdvanced: return 4; //not connected case WwanDataClass.None: return 0; //unkNown case WwanDataClass.Custom: default: return 0; } } else if (profile.IsWlanConnectionProfile) { return 100; } return 0; }
抱歉,我不知道操作符的名称,但接入点名称(APN)也可能有用,因为接入点已连接到操作符:
ConnectionProfile profile = networkinformation.GetInternetConnectionProfile(); string apn = profile.WwanConnectionProfileDetails.AccesspointName;
c# – 如何在Windows Phone 8.1(通用应用程序)中确定我是连接到WiFi还是移动网络?
如何确定手机是连接到WiFi还是移动网络?虽然从我的研究中我已经找到了使用旧版Windows Phone和Silverlight的方法,但似乎我只能确定该设备是否在Windows Universal应用程序中连接到互联网.
解决方法
ConnectionProfile
中确定这些信息:
using Windows.Networking.Connectivity; var connectionProfile = networkinformation.GetInternetConnectionProfile(); // connectionProfile can be null (e.g. airplane mode) if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile) { // do something over WiFi; }
还有IsWwanConnectionProfile属性,用于确定连接是否通过“移动”连接(3g等).
关于silverlight – 如何在Windows Phone 7中提取zip文件?和7zip怎么提取文件的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于c# – 如何在Windows Phone 7中以编程方式创建ListBox.Itemtemplate,datatemplate、c# – 如何在Windows Phone 7应用程序中以脱机模式从Web查看图像、c# – 如何在Windows Phone 8.1 Runtime中获取连接和操作符信息、c# – 如何在Windows Phone 8.1(通用应用程序)中确定我是连接到WiFi还是移动网络?的相关信息,请在本站寻找。
本文标签: