摘要: 一、C#的异常处理所用到关键字 try :用于检查发生的异常,并帮助发送任何可能的异常。 catch :以控制权更大的方式处理错误,可以有多个catch子句。 finally: 无论是否引发了异常,finally的代码块都将被执行。 throw: 用于引发异常,可引发预定义异常和自定义异常。... 阅读全文
posted @ 2014-11-13 10:36 _Dawn 阅读(1983) 评论(0) 推荐(0) 编辑
摘要: 1、XML序列化2、xml加密3、xml读取 阅读全文
posted @ 2014-11-13 09:16 _Dawn 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 我们在程序设计过程中,对Windows API函数调用是比不可少的,各种编程语言都规范了调用的方法和接口,在C#语言中的调用方法如下。 一、 在工程项目中添加一个类新项,打开这个类文件,在文件头部加入对以下命名空间的引用 using System.Runtime.InteropServic... 阅读全文
posted @ 2014-11-11 10:45 _Dawn 阅读(2231) 评论(0) 推荐(0) 编辑
摘要: 做WPF项目的时候,有时候为了突出详细内容。我们需要把菜单功能隐藏掉。如果简单的隐藏显示我们直接用:Visibility="Hidden"Visibility="Visible" 对象名.Visibility=new System.Windows.Visibility即可解决问题。软件用户体验是... 阅读全文
posted @ 2014-11-10 11:16 _Dawn 阅读(4152) 评论(0) 推荐(0) 编辑
摘要: Process 类 提供对本地和远程进程的访问并使您能够启动和停止本地系统进程。一、根据进程名获取对象 1 /// 2 /// 根据进程名获取Process对象 3 /// 4 /// 5 /// 6 publ... 阅读全文
posted @ 2014-11-10 11:00 _Dawn 阅读(258) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Runtime.InteropServices;using System.Tex... 阅读全文
posted @ 2014-11-02 21:50 _Dawn 阅读(958) 评论(0) 推荐(0) 编辑
摘要: //设置材质 Public GameObject _goItme Texture2D _requestTexture = null; try { _requestTextur... 阅读全文
posted @ 2014-10-14 09:56 _Dawn 阅读(2959) 评论(0) 推荐(0) 编辑
摘要: 如下图所示,请先在PlaySettings中修改Api Compatibility Level 改成.NET 2.0,如果不修改会报错注意:Error building Player: Extracting referenced dlls failed.无论你编译任何平台都请修改一下这里, 留言中有... 阅读全文
posted @ 2014-09-28 15:14 _Dawn 阅读(1360) 评论(0) 推荐(0) 编辑
摘要: DataTable:数据表,和数据库的表一样DataSet:数据集,里面由多个DataTable组成MySQLDataAdapter:数据适配器,用于从数据库读取数据//数据库连接对象(连接到指定数据)SqlConnectionconn=newSqlConnection("connection_st... 阅读全文
posted @ 2014-09-28 09:47 _Dawn 阅读(3440) 评论(1) 推荐(0) 编辑
摘要: //按返回键退出Applicationvoid Update () {if(Input.GetKey(KeyCode.Escape)){ Application.Quit();}} //按两次返回退出程序float _waitTime = 2f;//前后两次按退出间隔时间i... 阅读全文
posted @ 2014-05-17 11:11 _Dawn 阅读(1245) 评论(0) 推荐(0) 编辑