重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解
作者:webabcd
介绍
重新想象 Windows 8 Store Apps 之 通知
- Toast - 基本应用参见 http://www.cnblogs.com/webabcd/archive/2013/06/17/3139740.html
- Toast - 纯文本 toast
- Toast - 图文 toast
- Toast - toast 的提示音
- Toast - 按计划弹出 toast
示例
1、演示纯文本 toast 的 4 个模板
Notification/Toast/ToastWithText.xaml
<Page
x:Class="XamlDemo.Notification.Toast.ToastWithText"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamlDemo.Notification.Toast"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> <Grid Background="Transparent">
<StackPanel Margin="120 0 0 0"> <TextBox Name="lblMsg" Height="100" TextWrapping="Wrap" AcceptsReturn="True" FontSize="14.667" Margin="0 0 10 0" /> <Button Name="btnTextBodyWrap" Content="TextBodyWrap" Click="btnTextBodyWrap_Click_1" Margin="0 10 0 0" /> <Button Name="bntTextHeadingTextBodyWrap" Content="TextHeading TextBodyWrap" Click="bntTextHeadingTextBodyWrap_Click_1" Margin="0 10 0 0" /> <Button Name="bntTextHeadingWrapTextBody" Content="TextHeadingWrap TextBody" Click="bntTextHeadingWrapTextBody_Click_1" Margin="0 10 0 0" /> <Button Name="bntTextHeadingTextBody" Content="TextHeading TextBody1 TextBody2" Click="bntTextHeadingTextBody_Click_1" Margin="0 10 0 0" /> </StackPanel>
</Grid>
</Page>
Notification/Toast/ToastWithText.xaml.cs
/*
* 演示纯文本 toast 的 4 个模板
* 本示例的 Toast 的 XmlDocument 内容构造器采用一个开源项目,具体代码见:NotificationsExtensions/ToastContent.cs
*
* XmlDocument GetTemplateContent(ToastTemplateType type) - 获取系统支持的 Toast 模板
* ToastTemplateType.ToastText01, ToastTemplateType.ToastText02, ToastTemplateType.ToastText03, ToastTemplateType.ToastText04
*/ using NotificationsExtensions.ToastContent;
using Windows.UI.Notifications;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; namespace XamlDemo.Notification.Toast
{
public sealed partial class ToastWithText : Page
{
public ToastWithText()
{
this.InitializeComponent();
} private void btnTextBodyWrap_Click_1(object sender, RoutedEventArgs e)
{
IToastText01 templateContent = ToastContentFactory.CreateToastText01();
templateContent.TextBodyWrap.Text = "我是通知正文,可换行,最多三行。我是通知正文,可换行,最多三行。我是通知正文,可换行,最多三行。";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
} private void bntTextHeadingTextBodyWrap_Click_1(object sender, RoutedEventArgs e)
{
IToastText02 templateContent = ToastContentFactory.CreateToastText02();
templateContent.TextHeading.Text = "我是通知标题,不可以换行。我是通知标题,不可以换行。";
templateContent.TextBodyWrap.Text = "我是通知正文,可换行,最多两行。我是通知正文,可换行,最多两行。";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
} private void bntTextHeadingWrapTextBody_Click_1(object sender, RoutedEventArgs e)
{
IToastText03 templateContent = ToastContentFactory.CreateToastText03();
templateContent.TextHeadingWrap.Text = "我是通知标题,可换行,最多两行。我是通知标题,可换行,最多两行。";
templateContent.TextBody.Text = "我是通知正文,不可以换行。我是通知正文,不可以换行。";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
} private void bntTextHeadingTextBody_Click_1(object sender, RoutedEventArgs e)
{
IToastText04 templateContent = ToastContentFactory.CreateToastText04();
templateContent.TextHeading.Text = "我是通知标题,不可以换行。我是通知标题,不可以换行。";
templateContent.TextBody1.Text = "我是通知正文1,不可以换行。我是通知正文1,不可以换行。";
templateContent.TextBody2.Text = "我是通知正文2,不可以换行。我是通知正文2,不可以换行。";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
}
}
}
2、演示图文 toast 的 4 个模板
Notification/Toast/ToastWithImageText.xaml
<Page
x:Class="XamlDemo.Notification.Toast.ToastWithImageText"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamlDemo.Notification.Toast"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> <Grid Background="Transparent">
<StackPanel Margin="120 0 0 0"> <TextBox Name="lblMsg" Height="100" TextWrapping="Wrap" AcceptsReturn="True" FontSize="14.667" Margin="0 0 10 0" /> <Button Name="btnTextBodyWrap" Content="TextBodyWrap" Click="btnTextBodyWrap_Click_1" Margin="0 10 0 0" /> <Button Name="bntTextHeadingTextBodyWrap" Content="TextHeading TextBodyWrap" Click="bntTextHeadingTextBodyWrap_Click_1" Margin="0 10 0 0" /> <Button Name="bntTextHeadingWrapTextBody" Content="TextHeadingWrap TextBody" Click="bntTextHeadingWrapTextBody_Click_1" Margin="0 10 0 0" /> <Button Name="bntTextHeadingTextBody" Content="TextHeading TextBody1 TextBody2" Click="bntTextHeadingTextBody_Click_1" Margin="0 10 0 0" /> </StackPanel>
</Grid>
</Page>
Notification/Toast/ToastWithImageText.xaml.cs
/*
* 演示图文 toast 的 4 个模板(注:图片不能大于 1024*1024 像素,不能大于 200KB)
* 本示例的 Toast 的 XmlDocument 内容构造器采用一个开源项目,具体代码见:NotificationsExtensions/ToastContent.cs
*
* XmlDocument GetTemplateContent(ToastTemplateType type) - 获取系统支持的 Toast 模板
* ToastTemplateType.ToastImageAndText01, ToastTemplateType.ToastImageAndText02, ToastTemplateType.ToastImageAndText03, ToastTemplateType.ToastImageAndText04
*
* 注:图片可以来自程序包内,可以来自 Application Data(仅支持对 local 中图片文件的引用),可以来自一个 http 的远程地址
*/ using NotificationsExtensions.ToastContent;
using System;
using Windows.UI.Notifications;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; namespace XamlDemo.Notification.Toast
{
public sealed partial class ToastWithImageText : Page
{
public ToastWithImageText()
{
this.InitializeComponent();
} private void btnTextBodyWrap_Click_1(object sender, RoutedEventArgs e)
{
IToastImageAndText01 templateContent = ToastContentFactory.CreateToastImageAndText01();
templateContent.TextBodyWrap.Text = "我是通知正文,可换行,最多三行。我是通知正文,可换行,最多三行。我是通知正文,可换行,最多三行。";
templateContent.Image.Src = "Assets/Logo.png"; // 用程序包内文件作通知图片
templateContent.Image.Alt = "altText";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
} private void bntTextHeadingTextBodyWrap_Click_1(object sender, RoutedEventArgs e)
{
IToastImageAndText02 templateContent = ToastContentFactory.CreateToastImageAndText02();
templateContent.TextHeading.Text = "我是通知标题,不可以换行。我是通知标题,不可以换行。";
templateContent.TextBodyWrap.Text = "我是通知正文,可换行,最多两行。我是通知正文,可换行,最多两行。";
templateContent.Image.Src = "ms-appx:///Assets/Logo.png"; // 用程序包内文件作通知图片
templateContent.Image.Alt = "altText";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
} private void bntTextHeadingWrapTextBody_Click_1(object sender, RoutedEventArgs e)
{
IToastImageAndText03 templateContent = ToastContentFactory.CreateToastImageAndText03();
templateContent.TextHeadingWrap.Text = "我是通知标题,可换行,最多两行。我是通知标题,可换行,最多两行。";
templateContent.TextBody.Text = "我是通知正文,不可以换行。我是通知正文,不可以换行。";
templateContent.Image.Src = "ms-appdata:///local/Logo.png"; // 用 Application Data 内文件作通知图片(注:仅支持 local 中的图片)
templateContent.Image.Alt = "altText";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
} private void bntTextHeadingTextBody_Click_1(object sender, RoutedEventArgs e)
{
IToastImageAndText04 templateContent = ToastContentFactory.CreateToastImageAndText04();
templateContent.TextHeading.Text = "我是通知标题,不可以换行。我是通知标题,不可以换行。";
templateContent.TextBody1.Text = "我是通知正文1,不可以换行。我是通知正文1,不可以换行。";
templateContent.TextBody2.Text = "我是通知正文2,不可以换行。我是通知正文2,不可以换行。";
templateContent.Image.Src = "http://pic.cnblogs.com/avatar/a14540.jpg?id=24173245"; // 用远程文件作通知图片
templateContent.Image.Alt = "altText";
IToastNotificationContent toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
}
}
}
3、演示 Toast 的提示音
Notification/Toast/ToastWithSound.xaml
<Page
x:Class="XamlDemo.Notification.Toast.ToastWithSound"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamlDemo.Notification.Toast"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> <Grid Background="Transparent">
<StackPanel Margin="120 0 0 0"> <TextBox Name="lblMsg" Height="100" TextWrapping="Wrap" AcceptsReturn="True" FontSize="14.667" Margin="0 0 10 0" /> <TextBlock Text="通知提示音列表" Margin="0 10 0 0" />
<ListBox Name="listBox" SelectionChanged="listBox_SelectionChanged_1" Margin="0 10 10 0">
<ListBoxItem Content="Default" />
<ListBoxItem Content="Mail" />
<ListBoxItem Content="SMS" />
<ListBoxItem Content="IM" />
<ListBoxItem Content="Reminder" />
<ListBoxItem Content="LoopingCall" />
<ListBoxItem Content="LoopingCall2" />
<ListBoxItem Content="LoopingAlarm" />
<ListBoxItem Content="LoopingAlarm2" />
<ListBoxItem Content="Silent" />
</ListBox>
</StackPanel>
</Grid>
</Page>
Notification/Toast/ToastWithSound.xaml.cs
/*
* 演示 Toast 的提示音
*
* 目前支持的 Toast 提示音共有以下几种:
* Default, Mail, SMS, IM, Reminder, LoopingCall, LoopingCall2, LoopingAlarm, LoopingAlarm2, Silent
*/ using NotificationsExtensions.ToastContent;
using System;
using Windows.UI.Notifications;
using Windows.UI.Xaml.Controls; namespace XamlDemo.Notification.Toast
{
public sealed partial class ToastWithSound : Page
{
public ToastWithSound()
{
this.InitializeComponent();
} private void listBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
string audioType = (listBox.SelectedItem as ListBoxItem).Content.ToString(); IToastText02 toastContent = ToastContentFactory.CreateToastText02();
toastContent.TextHeading.Text = "Sound:";
toastContent.TextBodyWrap.Text = audioType;
toastContent.Audio.Content = (ToastAudioContent)Enum.Parse(typeof(ToastAudioContent), audioType); /*
* LoopingCall, LoopingCall2, LoopingAlarm, LoopingAlarm2 这 4 种提示音仅针对长时通知,且需指定为循环提示音
*/
if (audioType == "LoopingCall" || audioType == "LoopingCall2" || audioType == "LoopingAlarm" || audioType == "LoopingAlarm2")
{
toastContent.Duration = ToastDuration.Long;
toastContent.Audio.Loop = true;
} ToastNotification toast = toastContent.CreateNotification();
ToastNotificationManager.CreateToastNotifier().Show(toast); lblMsg.Text = toastContent.GetContent();
}
}
}
4、演示如何按计划显示 Toast 通知
Notification/Toast/ScheduledToast.xaml
<Page
x:Class="XamlDemo.Notification.Toast.ScheduledToast"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamlDemo.Notification.Toast"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> <Grid Background="Transparent">
<StackPanel Margin="120 0 0 0"> <!--显示当前 app 的全部 ScheduledToastNotification 对象列表-->
<ListBox Name="listBox" Width="800" Height="300" HorizontalAlignment="Left">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ToastId}" VerticalAlignment="Center" />
<TextBlock Text="{Binding Text}" Margin="15 0 0 0" VerticalAlignment="Center" />
<HyperlinkButton Name="btnRemove" Content="删除此 ScheduledToastNotification" Tag="{Binding ToastId}" Margin="15 0 0 0" Click="btnRemove_Click_1" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox> <Button Name="btnScheduledToast" Content="ScheduledToastNotification 的 Demo(3 秒后弹出 Toast 通知,然后每隔 60 秒再弹出一次,共重复 5 次)" Click="btnScheduledToast_Click_1" Margin="0 10 0 0" /> </StackPanel>
</Grid>
</Page>
Notification/Toast/ScheduledToast.xaml.cs
/*
* 演示如何按计划显示 Toast 通知
*
* ScheduledToastNotification - 按计划显示 Toast 通知
* Content - Toast 的内容,XmlDocument 类型的数据,只读,其需要在构造函数中指定
* DeliveryTime - 显示 Toast 通知的时间,只读,其需要在构造函数中指定
* SnoozeInterval - 循环显示 Toast 通知的间隔时长(60 秒 - 60 分之间),只读,其需要在构造函数中指定
* MaximumSnoozeCount - 循环的最大次数(1 - 5 次)
* Id - ScheduledToastNotification 的标识
*
* ToastNotifier - Toast 通知器
* AddToSchedule() - 将指定的 ScheduledToastNotification 添加到计划列表
* RemoveFromSchedule() - 从计划列表中移除指定的 ScheduledToastNotification
* GetScheduledToastNotifications() - 获取当前 app 的全部 ScheduledToastNotification 集合
*/ using NotificationsExtensions.ToastContent;
using System;
using System.Collections.Generic;
using Windows.UI.Notifications;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation; namespace XamlDemo.Notification.Toast
{
public sealed partial class ScheduledToast : Page
{
public ScheduledToast()
{
this.InitializeComponent();
} protected override void OnNavigatedTo(NavigationEventArgs e)
{
ShowScheduledToasts();
} // 添加指定的 ScheduledToastNotification 到计划列表中
private void btnScheduledToast_Click_1(object sender, RoutedEventArgs e)
{
IToastText02 toastContent = ToastContentFactory.CreateToastText02();
toastContent.TextHeading.Text = "ScheduledToastNotification Demo";
toastContent.TextBodyWrap.Text = "received: " + DateTime.Now.ToString("hh:mm:ss"); // 3 秒后显示 Toast,然后每隔 60 秒再显示一次 Toast(循环显示 5 次)
ScheduledToastNotification toast = new ScheduledToastNotification(toastContent.GetXml(), DateTime.Now.AddSeconds(), TimeSpan.FromSeconds(), ); string toastId = new Random().Next(, ).ToString();
toast.Id = toastId; // 将指定的 ScheduledToastNotification 添加进计划列表
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
toastNotifier.AddToSchedule(toast); ShowScheduledToasts();
} // 显示当前 app 的全部 ScheduledToastNotification 列表
private void ShowScheduledToasts()
{
List<MyScheduledToast> dataSource = new List<MyScheduledToast>(); // 获取当前 app 计划列表中的全部 ScheduledToastNotification 对象列表
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
IReadOnlyList<ScheduledToastNotification> scheduledToasts = toastNotifier.GetScheduledToastNotifications(); int toastCount = scheduledToasts.Count;
for (int i = ; i < toastCount; i++)
{
ScheduledToastNotification toast = scheduledToasts[i]; dataSource.Add(new MyScheduledToast()
{
ToastId = toast.Id,
Text = toast.Content.GetElementsByTagName("text")[].InnerText
});
} listBox.ItemsSource = dataSource;
} // 根据 ToastId 删除指定的 ScheduledToastNotification
private void btnRemove_Click_1(object sender, RoutedEventArgs e)
{
string toastId = (string)(sender as FrameworkElement).Tag; // 获取当前 app 计划列表中的全部 ScheduledToastNotification 对象列表
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
IReadOnlyList<ScheduledToastNotification> scheduledToasts = toastNotifier.GetScheduledToastNotifications(); int toastLength = scheduledToasts.Count;
for (int i = ; i < toastLength; i++)
{
if (scheduledToasts[i].Id == toastId)
{
// 从计划列表中移除指定的 ScheduledToastNotification 对象
toastNotifier.RemoveFromSchedule(scheduledToasts[i]); ShowScheduledToasts(); break;
}
}
} class MyScheduledToast
{
public string ToastId { get; set; }
public string Text { get; set; }
}
}
}
OK
[源码下载]
重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解的更多相关文章
- 重新想象 Windows 8 Store Apps (36) - 通知: Tile 详解
[源码下载] 重新想象 Windows 8 Store Apps (36) - 通知: Tile 详解 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 通知 Tile ...
- 重新想象 Windows 8 Store Apps (34) - 通知: Toast Demo, Tile Demo, Badge Demo
[源码下载] 重新想象 Windows 8 Store Apps (34) - 通知: Toast Demo, Tile Demo, Badge Demo 作者:webabcd 介绍重新想象 Wind ...
- 重新想象 Windows 8 Store Apps 系列文章索引
[源码下载][重新想象 Windows 8.1 Store Apps 系列文章] 重新想象 Windows 8 Store Apps 系列文章索引 作者:webabcd 1.重新想象 Windows ...
- 重新想象 Windows 8 Store Apps (67) - 后台任务: 推送通知
[源码下载] 重新想象 Windows 8 Store Apps (67) - 后台任务: 推送通知 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 后台任务 推送通 ...
- 重新想象 Windows 8 Store Apps (38) - 契约: Search Contract
[源码下载] 重新想象 Windows 8 Store Apps (38) - 契约: Search Contract 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 ...
- 重新想象 Windows 8 Store Apps (39) - 契约: Share Contract
[源码下载] 重新想象 Windows 8 Store Apps (39) - 契约: Share Contract 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 ...
- 重新想象 Windows 8 Store Apps (40) - 剪切板: 复制/粘贴文本, html, 图片, 文件
[源码下载] 重新想象 Windows 8 Store Apps (40) - 剪切板: 复制/粘贴文本, html, 图片, 文件 作者:webabcd 介绍重新想象 Windows 8 Store ...
- 重新想象 Windows 8 Store Apps (51) - 输入: 涂鸦板
[源码下载] 重新想象 Windows 8 Store Apps (51) - 输入: 涂鸦板 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 涂鸦板 通过 Poin ...
- 重新想象 Windows 8 Store Apps (53) - 绑定: 与 ObservableCollection CollectionViewSource VirtualizedFilesVector VirtualizedItemsVector 绑定
[源码下载] 重新想象 Windows 8 Store Apps (53) - 绑定: 与 ObservableCollection CollectionViewSource VirtualizedF ...
随机推荐
- Ecshop商品详情页显示当前会员等级价格
会员登录状态下,在ECSHOP商品详情页的本店售价中显示当前登录会员对应的等级价格,在未登录状态下,则还默认显示原来的本店售价. 解决方法: 这个需要修改ECSHOP程序代码来实现. 打开文件 /in ...
- 频域分辨率与DFT,DCT,MDCT理解
搞了这么久音频算法,有些细节还没有很清楚. 比如DFT和DCT有哪些区别,DFT系数为什么会是对称的,同样帧长的数据,各自的频域分辨率是多少? 今天决定搞清楚这些问题, 首先DFT的系数对称(2N点的 ...
- Creating Apps With Material Design —— Creating Lists and Cards
转载请注明 http://blog.csdn.net/eclipsexys 翻译自Developer Android.时间仓促,有翻译问题请留言指出,谢谢 创建Lisst和Cards 在你的应用程序创 ...
- C#新开一个线程取到数据,如何更新到主线程UI上面
一:问题 之前有被面试官问过,在WinForm中,要去网络上获取数据,由于网络环境等原因,不能很快的完成,因此会发生进程阻塞,造成主进程假死的现象,需要怎么解决? 二:思路 因此,往往是新 ...
- Swift:如何判断一个对象是否是某个类(或其子类)的实例
在OC中我们直接可以用如下方法即可 [obj isKindOfClass:[obj class]]; 在Swift中,并没有 .class 属性或者方法, 便可以用如下方法 class Person ...
- MassTransit_消费者的创建
Creating a message consumer A message consumer is a class that consumes one or more message types, s ...
- 使用Aspose.Cells 设置chart的y坐标轴显示值
目的:设置chart的y坐标轴显示值 用aspose.cell生成的chart生成的Y轴是默认生成的,自己要定义y轴坐标值1.把数据源写到excel里面,list里面2.y轴坐标自己定义 第一种:默认 ...
- Windows 10 Weather App无法正常显示解决方法
Weather动态磁贴显示Washington(不知是否和我的region设置有关系),打开应用却停留在输入需要搜索的天气.根据提示输入"Shanghai, China"并单击搜索 ...
- PyAMF and django ForeignKey
In order to support this, PyAMF needs to provide a synonym mapping between fields. Until then, you c ...
- 网络爬虫urllib2 tornado
百度不支持用tornado请求,可以用美团开放API 测试. import tornado.httpclient def fetch(url): http_header={'User-Agent':' ...