61阅读

免费提供数据包-Facebook为反恐人士提供免费广告

发布时间:2018-01-09 所属栏目:淘宝贷款是为淘宝店主提供融资服务

一 : Facebook为反恐人士提供免费广告

Facebook为反恐人士提供免费广告

  网易科技讯 2月16日消息,据《每日电讯》报道,为了对抗伊斯兰国在物联网上招募成员和煽动仇恨的言论,Facebook将为提供打击恐怖主义的团体和个人提供免费的广告宣传。

  Facebook将提供最高1000美元的广告宣传费用给反恐和反仇恨言论的积极分子。如德国喜剧演员Arbi el Ayachi,他发布了一个视频来讽刺反穆斯林的希腊右翼团体。

  这种策略被称为“反对言论”,Facebook将鼓励用户积极反对极端主义观点。Facebook显然也在与美国国务院和咨询公司合作,让大学生参与到“反对言论”比赛,预算为2000美元。

  Facebook首席运营官桑德伯格上月在达沃斯世界经济论坛上表示,尽管没有学术证据来支持这种想法(“反对言论”)。但她表示,现实已形成良性循环。德国一个名为“反纳粹”的团体,通过攻击极右翼新民主党的Facebook页面来获得粉丝的支持,这样的事每天都在上演。(持文)

二 : 苛苛非主流服饰专卖店 免费招收大量代理 一件代发 提供淘宝数据包、图片

苛苛非主流服饰专卖店 免费招收大量代理 一件代发 提供淘宝数据包、图片包

本店提供:苛苛服饰、假发、美瞳

淘宝网店地址:http://hello- www.61k.com
空间店地址:http://hello- www.61k.com

旺旺:小葵的非主流
QQ:511534226

代理折扣:

基础代理折扣为85折;
当月下单满15件,85折代理折扣+1元/单的返利;
当月下单满50件,代理折扣享8折(月底返折);
当次下单满30件,批发折扣享8折(不加返利);

折扣和利润均为当月月底返回!!!(返折刨除运费计算!)

代理条件:

只要有自己的网店,每月可定时更新铺入我们的商品,就可以免费申请我们的网店代理啦!无须代理费用,提供淘宝数据包,图片包!

三 : WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider

在WPF中系统提供了两个数据源提供器(DataProvider):对象数据源提供器(ObjectDataProvider)和XML数据源提供器(XmlDataProvider)。[www.61k.com]其作用类似于ASP.Net数据源(DataSource)中的对象数据源(ObjectDataSource)和Xml数据源(XmlDataSource)。其继承结构如下:

龙腾于海 WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider)

ObjectDataProvider用于处理由方法返回值所产生的数据源,其应用非常广泛,通常多层应用程序通常在界面上使用ObjectDataProvider处理由组件层所产生的数据。在本节中我们主要处理ObjectDataProvider,对于XmlDataProvider感兴趣的朋友可以参考MSDN。

一、组件端定义

例如:定义一个类库项目,在其中定义一个ProductInfo类、CategoryInfo类,用来封装Northwind数据库中的Products表及Categories表中的数据。定义NorthwindDataSet,包含Product、Category两个DataTable。定义DataControl类,处理对Northwind数据库的操作,返回相应的封装后的类型或集合作为界面显示的数据源。

1、ProductInfo类和CategoryInfo类

1: namespace WPF_24_Library
2: {
3: /// <summary>
4: /// 封装产品表的信息
5: /// </summary>
6: public class ProductInfo
7: {
8: public int ProductID
9: {
10: set; get;
11: }
12: public string ProductName
13: {
14: set; get;
15: }
16: public decimal UnitPrice
17: {
18: set; get;
19: }
20: public int CategoryID
21: {
22: set; get;
23: }
24: }
25: }

 

1: using System.Collections.Generic;
2: 
3: namespace WPF_24_Library
4: {
5: /// <summary>
6: /// 封装类别表的信息
7: /// </summary>
8: public class CategoryInfo
9: {
10: public CategoryInfo()
11: {
12: Products = new List<ProductInfo>();
13: }
14: 
15: public int CategoryID
16: {
17: set; get;
18: }
19: public string CategoryName
20: {
21: set; get;
22: }
23: 
24: /// <summary>
25: /// 封装该类别的所有产品
26: /// </summary>
27: public List<ProductInfo> Products
28: {
29: private set; get;
30: }
31: }
32: }

2、类型化DataSet

此类型化DataSet由Visual Studio IDE生成:

龙腾于海 WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider)

3、DataControl类

DataControl类用来处理所有的数据库的操作,其功能分为以下几个部分:

  • 基于返回集合的方法GetAllProductInfo
  • 基于返回集合并带参数的方法GetProductInfoByCategoryID
  • 基于返回带主从关联数据的集合的方法GetAllCategoriesWithProducts
  • 基于返回带主从关联数据的类型化DataSet的方法GetNorthwindDataSet

1: using System.Collections.Generic;
2: using System.Data;
3: using System.Data.SqlClient;
4: 
5: namespace WPF_24_Library
6: {
7: public static class DataControl
8: {
9: // 连接字符串
10: private const string CONNECTION_STRING =
11: @"Server=.;Integrated Security=SSPI;Database=Northwind";
12: 
13: // 所使用的各存储过程的名称
14: private const string SQL_GETALLPRODUCTINFO = "sp_GetAllProductInfo";
15: private const string SQL_GETPRODUCTINFOBYCATEGORYID = "sp_GetProductInfoByCategoryID";
16: private const string SQL_GETALLCATEGORIES = "sp_GetAllCategories";
17: 
18: /// <summary>
19: /// 获取所有的产品
20: /// </summary>
21: /// <returns></returns>
22: public static List<ProductInfo> GetAllProductInfo()
23: {
24: SqlCommand command = new SqlCommand();
25: command.CommandType = CommandType.StoredProcedure;
26: command.CommandText = SQL_GETALLPRODUCTINFO;
27: 
28: List<ProductInfo> result = GetProducts(command);
29: 
30: return result;

扩展:wpf silverlight / wpf silverlight 区别 / wpf和silverlight教程

31: }
32: 
33: /// <summary>
34: /// 根据产品类别获取此类别的产品
35: /// </summary>
36: /// <param name="categoryID"></param>
37: /// <returns></returns>
38: public static List<ProductInfo> GetProductInfoByCategoryID(int categoryID)
39: {
40: SqlCommand command = new SqlCommand();
41: command.CommandType = CommandType.StoredProcedure;
42: command.CommandText = SQL_GETPRODUCTINFOBYCATEGORYID;
43: 
44: command.Parameters.Add("@categoryID", SqlDbType.Int).Value = categoryID;
45: 
46: List<ProductInfo> result = GetProducts(command);
47: 
48: return result;
49: }
50: 
51: /// <summary>
52: /// 封装产品数据
53: /// </summary>
54: /// <param name="command"></param>
55: /// <returns></returns>
56: private static List<ProductInfo> GetProducts(SqlCommand command)
57: {
58: SqlConnection connection = new SqlConnection();
59: connection.ConnectionString = CONNECTION_STRING;
60: connection.Open();
61: 
62: command.Connection = connection;
63: 
64: SqlDataReader dataReader = command.ExecuteReader();
65: List<ProductInfo> result = new List<ProductInfo>();
66: while (dataReader.Read())
67: {
68: int id = dataReader.GetInt32(0);
69: string name = dataReader.GetString(1);
70: int categoryID = dataReader.GetInt32(2);
71: decimal unitprice = dataReader.GetDecimal(3);
72: 
73: ProductInfo info = new ProductInfo()
74: {
75: ProductID = id,
76: ProductName = name,
77: CategoryID = categoryID,
78: UnitPrice = unitprice
79: };
80: result.Add(info);
81: }
82: dataReader.Close();
83: connection.Close();
84: 
85: return result;
86: }
87: 
88: /// <summary>
89: /// 获取所有的类别及该类别的产品
90: /// </summary>
91: /// <returns></returns>
92: public static List<CategoryInfo> GetAllCategoriesWithProducts()
93: {
94: SqlConnection connection = new SqlConnection();
95: connection.ConnectionString = CONNECTION_STRING;
96: connection.Open();
97: 
98: SqlCommand command = new SqlCommand();
99: command.CommandType = CommandType.StoredProcedure;
100: command.CommandText = SQL_GETALLCATEGORIES;
101: 
102: SqlDataReader dataReader = command.ExecuteReader();
103: List<CategoryInfo> result = new List<CategoryInfo>();
104: while (dataReader.Read())
105: {
106: int id = dataReader.GetInt32(0);
107: string name = dataReader.GetString(1);
108: 
109: CategoryInfo info = new CategoryInfo()
110: {
111: CategoryID = id,
112: CategoryName = name,
113: };
114: result.Add(info);
115: }
116: dataReader.Close();
117: connection.Close();
118: 
119: foreach (CategoryInfo info in result)
120: {
121: info.Products.AddRange(
122: GetProductInfoByCategoryID(info.CategoryID));
123: }
124: 
125: return result;
126: }
127: 
128: /// <summary>
129: /// 获取封装所有类别及产品的DataSet
130: /// </summary>
131: /// <returns></returns>

扩展:wpf silverlight / wpf silverlight 区别 / wpf和silverlight教程

132: public static NorthwindDataSet GetNorthwindDataSet()
133: {
134: SqlDataAdapter categoryAdapter = new SqlDataAdapter(
135: SQL_GETALLCATEGORIES, CONNECTION_STRING);
136: categoryAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
137: 
138: SqlDataAdapter productAdapter = new SqlDataAdapter(
139: SQL_GETALLPRODUCTINFO, CONNECTION_STRING);
140: productAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
141: 
142: NorthwindDataSet result = new NorthwindDataSet();
143: 
144: categoryAdapter.Fill(result.Categories);
145: productAdapter.Fill(result.Products);
146: 
147: return result;
148: }
149: }
150: }

二、基本ObjectDataProvider操作

(将上部分类库项目引入WPF应用程序项目中)

使用ObjectDataProvider时需提供以下几个部分:

  • x:Key:此Provider对应的资源的名称,将在界面某组件的DataContext引用,以作为数据源
  • ObjectType:包含返回数据源的方法的类,其语法上是这样的:ObjectType=”{x:Type 类名}”,此外还需要引用相应的命名空间
  • MethodName:返回数据源的方法的方法名

例如:将GetAllProductInfo方法返回的List<ProductInfo>泛型集合做为数据源,绑定到ListBox上:

1: <Window x:Class="WPF_24.WinObjectDataProviderDemo1"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:lib="clr-namespace:WPF_24_Library;assembly=WPF_24_Library"
5: Title="ObjectDataProvider Demo 1" Height="300" Width="300">
6: <Window.Resources>
7: <ObjectDataProvider x:Key="productInfoSource"
8: ObjectType="{x:Type lib:DataControl}"
9: MethodName="GetAllProductInfo" />
10: </Window.Resources>
11: <Grid>
12: <ListBox Margin="5"
13: DataContext="{StaticResource productInfoSource}"
14: ItemsSource="{Binding}"
15: DisplayMemberPath="ProductName"
16: SelectedValuePath="ProductID" />
17: </Grid>
18: </Window>

此处的DataContext可以写在ListBox中,好可以写在Grid或Window的DataContext中。在ListBox中ItemsSource的值为默认的Binding,未定义Path,即直接将方法返回的List集合的结果显示在ListBox中。执行的结果如下:

龙腾于海 WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider)

二、为ObjectDataProvider设置参数

在ObjectDataProvider的MethodParameters中可以添加ObjectDataProvider的参数,例如使用GetProductInfoByCategoryID,根据类别查询产品:

1: <Window x:Class="WPF_24.WinObjectDataProviderDemo2"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:lib="clr-namespace:WPF_24_Library;assembly=WPF_24_Library"
5: xmlns:System="clr-namespace:System;assembly=mscorlib"
6: Title="WinObjectDataProviderDemo2" Height="300" Width="300">
7: <Window.Resources>
8: <ObjectDataProvider x:Key="productInfoByCategoryIDSource"
9: ObjectType="{x:Type lib:DataControl}"
10: MethodName="GetProductInfoByCategoryID">
11: <ObjectDataProvider.MethodParameters>
12: <System:Int32>0</System:Int32>
13: </ObjectDataProvider.MethodParameters>
14: </ObjectDataProvider>
15: </Window.Resources>
16: <Grid>
17: <Grid.RowDefinitions>
18: <RowDefinition Height="23" />
19: <RowDefinition />
20: </Grid.RowDefinitions>
21: <StackPanel Grid.Row="0" Orientation="Horizontal"
22: HorizontalAlignment="Center" VerticalAlignment="Center" >
23: <TextBlock Margin="5,0" Text="CategoryID:" VerticalAlignment="Center" />

扩展:wpf silverlight / wpf silverlight 区别 / wpf和silverlight教程

24: <TextBox Margin="5,0" Width="80" Text="0" x:Name="txtCategoryID" />
25: <Button Margin="5,0" Width="50" Content="OK" Click="Button_Click" />
26: </StackPanel>
27: <ListBox Grid.Row="1"
28: DataContext="{StaticResource productInfoByCategoryIDSource}"
29: ItemsSource="{Binding}"
30: DisplayMemberPath="ProductName"
31: SelectedValuePath="ProductID" />
32: </Grid>
33: </Window>

此外,可以通过代码更改参数的值:

1: private void Button_Click(object sender, RoutedEventArgs e)
2: {
3: int categoryID = int.Parse(txtCategoryID.Text);
4: 
5: ObjectDataProvider provider =
6: (ObjectDataProvider)(this.FindResource("productInfoByCategoryIDSource"));
7: provider.MethodParameters[0] = categoryID;
8: }

龙腾于海 WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider)

三、带主从关联数据的数据显示

龙腾于海 WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider)

所谓的“主从数据”所指的例如上图中,左侧为所有的类别,右侧为当前选中类别的所有产品,其实现的XAML如下:

1: <Window x:Class="WPF_24.WinObjectDataProviderDemo4"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:lib="clr-namespace:WPF_24_Library;assembly=WPF_24_Library"
5: Title="WinObjectDataProviderDemo4" Height="300" Width="500">
6: <Window.Resources>
7: <ObjectDataProvider x:Key="myCategories"
8: ObjectType="{x:Type lib:DataControl}"
9: MethodName="GetAllCategoriesWithProducts" />
10: </Window.Resources>
11: <Grid DataContext="{StaticResource myCategories}">
12: <Grid.ColumnDefinitions>
13: <ColumnDefinition Width="2*" />
14: <ColumnDefinition Width="3*" />
15: </Grid.ColumnDefinitions>
16: <ListBox Grid.Column="0"
17: ItemsSource="{Binding}"
18: DisplayMemberPath="CategoryName"
19: SelectedValuePath="CategoryID"
20: SelectedIndex="0"
21: IsSynchronizedWithCurrentItem="True" />
22: <ListBox Grid.Column="1"
23: ItemsSource="{Binding Path=Products}"
24: DisplayMemberPath="ProductName"
25: SelectedValuePath="ProductID" />
26: </Grid>
27: </Window>

需要注意的是,默认情况下,ListBox不会同步数据源当前项的变更改,需要使用第21行的代码,以实现点击左侧的ListBox的某一项,同时更改右侧该类别的产品。

四、使用DataSet做为数据源

将DataSet做为数据源时大体与集合相同,但要注意,DataContext对应的数据源类型是一个DataSet时,Binding时需使用Path指定控件对应绑定到的DataTable。

1: <Window x:Class="WPF_24.WinObjectDataProviderDemo3"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:lib="clr-namespace:WPF_24_Library;assembly=WPF_24_Library"
5: Title="WinObjectDataProviderDemo3" Height="300" Width="500">
6: <Window.Resources>
7: <ObjectDataProvider x:Key="myDataSetSource"
8: ObjectType="{x:Type lib:DataControl}"
9: MethodName="GetNorthwindDataSet" />
10: </Window.Resources>
11: <Grid DataContext="{StaticResource myDataSetSource}" x:Name="grid">
12: <Grid.ColumnDefinitions>
13: <ColumnDefinition Width="2*" />
14: <ColumnDefinition Width="3*" />

扩展:wpf silverlight / wpf silverlight 区别 / wpf和silverlight教程

15: </Grid.ColumnDefinitions>
16: <ListBox Grid.Column="0" SelectedIndex="0"
17: ItemsSource="{Binding Path=Categories}"
18: DisplayMemberPath="CategoryName"
19: SelectedValuePath="CategoryID"
20: SelectionChanged="ListBox_SelectionChanged"
21: IsSynchronizedWithCurrentItem="True"
22: x:Name="lst"/>
23: <ListBox Grid.Column="1"
24: ItemsSource="{Binding Path=Categories/FK_Products_Categories}"
25: DisplayMemberPath="ProductName"
26: SelectedValuePath="ProductID" />
27: </Grid>
28: </Window>

另外还需要注意的是第24行,绑定主从数据时,子数据绑定的Path为“主表名/关系名”。

应用程序执行的结果如下:

龙腾于海 WPF and Silverlight 学习笔记(二十四):数据源提供器(DataProvider)

 

附:代码所使用的存储过程:

1: use Northwind
2: GO
3: 
4: Create Proc sp_GetAllProductInfo
5: As
6: Select ProductID,ProductName,CategoryID,UnitPrice
7: From Products
8:
9: GO
10: 
11: Create Proc sp_GetProductInfoByCategoryID
12: @categoryID int
13: As
14: if @categoryID is null or @categoryID=0
15: Select ProductID,ProductName,CategoryID,UnitPrice
16: From Products
17: else
18: Select ProductID,ProductName,CategoryID,UnitPrice
19: From Products
20: Where CategoryID=@categoryID
21: 
22: GO
23: 
24: Create Proc sp_GetAllCategories
25: As
26: Select CategoryID,CategoryName
27: From Categories

 

本系列博客索引页

扩展:wpf silverlight / wpf silverlight 区别 / wpf和silverlight教程

四 : 15省市3000万数据供公众免费查询

截止12月15日,北京、天津、河北、山西、辽宁、哈尔滨、上海、江苏、安徽、福建、山东、广东、湖南、重庆、陕西等15省市3000万企业数据已在名索网(www.mingsuo.com)全部上线。本次数据将覆盖华北、东北、华东、中南、西南、西北六个区域,成为中国最大、最专业的企业数据查询平台。

即日起,公众登录名索网首页,可以按照企业名称、企业注册号、法定代表人姓名等三种方式实现以上企业身份信息的查询。同时,也可以通过“默认城市”中的区域分类和“查询省市快速切换”频道中所列举的省市进行查询。当然,如果您还有其他疑问,还可以拨打我们的热线电话:010—59827810/60进行咨询,我们会竭诚为您解答查询中的任何问题。

15省市3000万数据供公众免费查询

此次数据的全面上线,使名索网在经历了将近半年的酝酿之后迎来质的飞跃:查询区域由原来的一个城市增加至15个省市,企业数据由原来的200多万增加到3000多万,从而在根本上提高司法、政府、金融、通信、IT、电子商务、房地产、招聘等诸多行业用户的应用功能和价值。

此外,在本月下旬,名索网还将为公众开通河南、四川、湖北、广西等省市的企业数据,届时名索网企业数据将覆盖全国70%以上省市,所有企业数据也将增加到4000万,敬请各位屏息期待,我们将一如既往地为您提供最优质的服务和最准确的信息。____________________________________________________________________________________________

查企业就上名索网 www.mingsuo.com

精彩博文推荐:

发布虚假药品信息销售假药23家网站被曝光

证监会:黄光裕事涉中关村、三联商社重组

2008中国互联网的亢奋与失落(二)

2008中国互联网的亢奋与失落(一)

2008年第三季度中国网络购物市场环比增速放缓

“三无”港商诈骗17亿“CBD神话”轰然破灭

我国电子商务渐入佳境

五 : 微软提供限时免费PCmover Express工具:将数据轻松转移到Win10电脑

当然,有部分用户会选择直接购买预装Win10的新电脑,这时免不了要对数据进行迁移。如果你有大容量移动硬盘,最好不过了。如果没有移动硬盘,还可选择通过网络进行数据转移。

为了简化用户的数据迁移任务,帮助用户轻松将数据从旧Windows电脑转移到Win10新电脑中,微软与PCmover开发商合作提供限时免费的PCmover Express工具。有需要的用户可下载使用。

PCmover Express工具下载:

免费期限:2015年9月1日至2016年8月31日,点此查看使用帮助。

本文标题:免费提供数据包-Facebook为反恐人士提供免费广告
本文地址: http://www.61k.com/1121309.html

61阅读| 精彩专题| 最新文章| 热门文章| 苏ICP备13036349号-1