//实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelWidth; int newPixelHeight; //构造函数里 //从页面读取输入值作为目标分辨率 newPixelHeight = int.Parse(textBox2.Text.ToString()); //从页面读取输入值作为目标分辨率 newPixelHeight = int.Parse…
<Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> <Style TargetType="Image"> <Setter Property="Margin" Value="-12,-36,0,0"/> </Style> </Grid.Resources>…
PhotoChooserTask photoChooserTask = new PhotoChooserTask(); photoChooserTask.Completed += photoChooserTask_Completed; photoChooserTask.ShowCamera = true; photoChooserTask.Show(); void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.T…
//获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anonymousUserId = ""; try { if (UserExtendedProperties.TryGetValue("ANID2", out anid)) { if (null == anid) { return string.Empty; } anonymou…
static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> list = new List<Color>(); list.Add(Colors.Blue); list.Add(Colors.Brown); if (isbool) { tile.Background = ]); isbool = false; } else { tile.Backgrou…
public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Dispatcher.BeginInvoke(delegate { Application.Current.UnhandledException += UnhandledException; }); } private static void UnhandledException(object sender…
List<NotifyMsg> arraymsg = new List<NotifyMsg>(); List<NotifyInfo> ArrayNotifyInfo = new List<NotifyInfo>() { new NotifyInfo(){title="[收信宝]开通失败",content="您的[收信宝]服务未能开通,请重试或联系客服确认订单.{失败原因:失败原因,新快捷支付:支付失败,请重新支付,或联系客服确认…
public class UserInfoDB : BaseDB { public UserInfoDB() : base(@"Data Source=isostore:\MakeLove\Database\Love.sdf") { if (!this.DatabaseExists()) { CreateDatabase(); //创建数据库时,现将数据库版本号设置为2 DatabaseSchemaUpdater schemaUpdater = this.CreateDatabaseS…
public class CCSetting { public async static void AddOrUpdateValue<T>(string key, T value) { try { if (key != null) { StorageFolder floder = ApplicationData.Current.LocalFolder; if (!(await floder.GetFoldersAsync()).Any(a => a.Name == "DrieS…
         /// <summary>        /// 颜色字符串转Color        /// </summary>        public static Color ConvertFromString(string argb)        {            uint result;            if (uint.TryParse(argb.TrimStart('#', '0'), NumberStyles.HexNumber, null,…
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <StackPanel Orientation="Vertical"> <TextBlock Text="Hides soft keyboard on enter:" /> <TextBox x:Name="textBox"…
<Grid x:Name="LayoutRoot" Background="White"> <Grid Width="480" Height="320" VerticalAlignment="Top" Background="#FF2B579A"> <Grid Name="bgrid" Width="480" Heig…
Stopwatch time = new Stopwatch(); byte[] target = new byte[size]; for (int j = 0; j < size; j++) target[j] = unchecked((byte)j); //Otherwise parts of the array are optimised out. CCMD5Core.GetHash(target); time.Start(); for (int i = 1; i <= iteratio…
<phone:PhoneApplicationPage.Resources> <Style x:Key="ButtonStyle1" TargetType="Button"> <Setter Property="Background" Value="Transparent"/> <Setter Property="BorderBrush" Value="{…
<Grid > <Grid x:Name="bubble_right" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Visibility="{Binding showright}" MinWidth="80"> <Grid Mar…
抓包工具Fiddler的使用 Fiddler是一款免费且功能强大的数据包抓取软件.它通过代理的方式获取程序http通讯的数据.我们可以利用它来检测网页和服务器的交互情况.下面,我们以http://blog.cersp.com/index/1000176.jspx的网址列表的获取说明一下如何使Fiddler配合火车采集器获取网址列表,以http://bbs.locoy.com的附件下载为例说明一下cookie的获取.. Fiddler下载地址:http://www.fiddler2.com/dl/…
http://msdn.microsoft.com/zh-cn/library/bb397924.aspx LINQ 查询操作中的类型关系 (C#) 使用一个人类发明快速检索的方法 // Northwnd inherits from System.Data.Linq.DataContext. Northwnd nw = new Northwnd(@"northwnd.mdf"); // or, if you are not using SQL Server Express // Nor…
WebClient wc = new WebClient(); var URI = new Uri("http://your_uri_goes_here"); //If any encoding is needed. wc.Headers["Content-Type"] = "application/x-www-form-urlencoded"; //Or any other encoding type. //If any key needed…
DateTime.Now.ToShortTimeString()DateTime dt = DateTime.Now;dt.ToString();//2005-11-5 13:21:25dt.ToFileTime().ToString();//127756416859912816dt.ToFileTimeUtc().ToString();//127756704859912816dt.ToLocalTime().ToString();//2005-11-5 21:21:25dt.ToLongDat…
Dispatcher.BeginInvoke(() => MessageBox.Show(String.Format("A push notification {0} error occurred. {1} ({2}) {3}", e.ErrorType, e.Message, e.ErrorCode, e.ErrorAdditionalData)) ); 用在其上创建了 Dispatcher 的线程的指定参数异步执行指定委托 http://msdn.microsoft.com/…
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/?sref=transforms_ovw_animating_transforms public Storyboard HideStoryBoard() { Storyboard storyboard = new Storyboard(); double num = 0.2; DoubleAnimation animation = new DoubleAn…
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal"> <TextBlock Text="昵称:" Style="{StaticResource InStyle_SLMTB}"/> <Grid Margin="10,10,0,10" Width="320"…
书名 <SQL Server从入门到精通> 图片 时间 2017-6月 学习 书还可以看完不痛不痒 光盘里面是c的视频有趣这是要我学c的节奏啊,可以写一些基础sql语句也是一门语言叫T-sql 就是感觉软件太大了配合vs 8G内存根本不够啊 …
导读 互联网环境中的文件如何存储? 不能存本地应用服务器 NFS(采用mount挂载) HDFS(适合大文件) FastDFS(强力推荐…
本系列目录:ASP.NET MVC4入门到精通系列目录汇总 有好一段时间没更新博文了,最近在忙两件事:1.看书,学习中...2.为公司年会节目做准备,由于许久没有练习双截棍了,难免生疏,所以现在临时抱佛脚.深圳最近的天气反常,许多人感冒了,我也成为其中之一,大家注意身体... 这一篇,我来简单的讲一下接下来项目中会用到的一些杂七杂八的技术. 区域及分离 在15.ASP.NET MVC入门到精通——MVC-路由中,我已经简要说明了区域的分离. 1.右键单击Web项目,“添加”——“区域”,区域名,…
最近在做图片上传功能,类似于微信朋友圈的功能,现在的手机像素都比较高,手机上的图片一般都比较大(几M),对于大图,在上传之前,我们需要对图片进行压缩(分辨率和质量),再上传到服务器,以减少网路流量传输 实现思路: 判断图片是否大于指定的大小 否:原图上传 是:通过BitmapImage检测出图片分辨率,然后将分辨率限制在1200*1200分辨率以内(保持宽高比),然后通过SaveJpeg方法写入到流中 笔者测试,绝大部分图片处理后都能控制在300kb以内(部分超过一点) using System…
目录: 前序 效果图 简介 全部代码 前序: 接触 golang 不久,一直是边学边做,边总结,深深感到这门语言的魅力,等下要跟大家分享是最近项目 服务端 用到的图片压缩程序,我单独分离了出来,做成了 exe 程序,可以在 Window 下运行.也可以放到 Linux 环境下编译运行,golang 是一种静态.跨平台的语言. 效果图 - 压缩前 压缩后 开始main: showTips 做了一些有好提示的文字输出,execute 是核心,压缩函数的调用也在里面 func main() { sho…
序言 最近公司在招.NET程序员,我发现好多来公司面试的.NET程序员居然都没有 ASP.NET MVC项目经验,其中包括一些工作4.5年了,甚至8年10年的,许多人给我的感觉是:工作了4.5年,Web开发依旧停留在拖控件的水平,最最基本的算法,递归.排序(我不要求快速排序,你会冒泡就行了)都不会,数据库方面,很基础的SQL都写不出,分组过滤也不会,更别提性能了,问下数据优化经验,除了回答加索引基本就没下文了.当然,一些过去N年都是做ASP.NET WebForm开发的,不熟悉MVC,那也没关系…
本系列目录:ASP.NET MVC4入门到精通系列目录汇总 开发流程 新建Controller 创建Action 根据Action创建View 在Action获取数据并生产ActionResult传递给View. View是显示数据的模板 Url请求→Controller.Action处理→View响应 url请求→Controller.Action处理→View响应 开发环境:VS2012 .SQL Sserver2008 1.打开VS,文件——新建项目Guestbook 点击确定后,会出现如…