摘要: 敏捷学院C#基础演练1.0更新:2011-07-15 访问:21Lesson01 开发工具的演练Lesson02 输入输出、类型、语句Lesson03 数组、枚举、结构Lesson04 类和对象敏捷学院C#基础演练是由敏捷学院推出的适合没有任何编程基础的初学者练习使用演练代码。敏捷学院C#基础演练是为本部学员代码训练使用的内部教程。现在共享给大家。通过认真的完成本演练,您将掌握C#语言的语法,为学习高级的C#开发奠定良好的基础。 阅读全文
posted @ 2011-07-15 22:26 敏捷学院 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 原文链接http://dev.mjxy.cn/a-Javascript-selected-add-and-delete-items.aspx/* ---------------------------------------------------------------- ComboAdd: Add a new item to a SELECT HTML object at runtime. Parameters: Object = SELECT Object ID Value = Value of the String ... <option VALUE="?????&qu 阅读全文
posted @ 2011-07-15 12:06 敏捷学院 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://dev.mjxy.cn/a-Javascript-verify-the-IP-address.aspx// Validate an IP Address (IP Version 4 - IPV4) function fnValidateIPAddress(ipaddr) { var re = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; if (re.test(ipaddr)) { //split into units with dots "." var parts = ipaddr.split(".&qu 阅读全文
posted @ 2011-07-15 12:01 敏捷学院 阅读(469) 评论(0) 推荐(0) 编辑
摘要: http://dev.mjxy.cn/a-How-to-receive-the-return-value-stored-procedure.aspxASP.NET 里接收存储过程的返回值,需要定义参数. 而不是 ExecuteNoQuery的结果.using (SqlConnection cn = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("Get4LayerIsA", cn); cmd.CommandType = CommandType.StoredProcedu 阅读全文
posted @ 2011-07-14 09:47 敏捷学院 阅读(438) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-How-to-calculate-the-return-time-of-the-page.aspx服务器端开始计时:ViewData["result"] = DateTime.Now.TimeOfDay.TotalMilliseconds;页面最后调用脚本计算<span id="times" title="<%:ViewData["result"]%>"><%:ViewData["result"]%></s 阅读全文
posted @ 2011-07-14 09:41 敏捷学院 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-Calendar-calendar-control-multiple-dates-selection.aspx//处理Calendar1的SelectionChanged事件 protected void Calendar1_SelectionChanged(object sender, EventArgs e) { List<DateTime> lst = SelectDate; if (lst.Contains(Calendar1.SelectedDate)) { lst.Remove(Calendar1.SelectedDate 阅读全文
posted @ 2011-07-14 09:32 敏捷学院 阅读(2018) 评论(0) 推荐(0) 编辑
摘要: 转载地址:http://dev.mjxy.cn/a-How-to-customize-the-IHttpModule.aspx使用自定义的 IHttpModule 方法可以实现自己想要的url重写功能。1. 自定义类 HttpModule 继承 IHttpModule实现接口的Init方法,在方法中处理BeginRequest事件。public class HttpModule : IHttpModule { #region IHttpModule 成é员± public void Dispose() { } public void Init(HttpApplication 阅读全文
posted @ 2011-07-14 09:22 敏捷学院 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-How-to-customize-the-IHttpHandler.aspx定义处理HttpHandler 让ModuleX加载的时候稍有延迟。public class DelayDownloadHandler :IHttpHandler { public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { string path = context.Server.MapPath(context.Request.Pat 阅读全文
posted @ 2011-07-14 09:21 敏捷学院 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-Silverlight-Prism-Hand-On-Lab.aspx使用Prism开发Silverlight1.新建Silverlight项目HelloWorld.Silverlight2.更改MasterPage.xaml为Shell。注意类型3.在Shell中引用xmlns:Regions="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation" 阅读全文
posted @ 2011-07-12 01:09 敏捷学院 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-Installation-ckeditor.aspx1. 下载ckeditorhttp://ckeditor.com/2. 解压后将ckeditor和ckfinder目录复制到项目中3. 修改配置文件ckeditor/config.js config.language = 'zh-cn'; //中文 config.uiColor = '#BFEE62'; //编辑器颜色 config.font_names = '宋体;楷体_GB2312;新宋体;黑体;隶书;幼圆;微软雅黑;Arial;Comic Sans 阅读全文
posted @ 2011-07-12 00:52 敏捷学院 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-FCKeditorNET-custom-upload-directory-and-file-names-automatically-generated.aspx使用用FCKeditor的上传功能,我们会发现上传后的文件名和本地的是一样的,不会自动更改文件名,这样有时候本地是中文文件名的时候就不是太好了。下面是我对FCKeditor.NET源文件的修改,使上传文件自动生成随机文件名,而且上传目录根据当前时间归类,这样方便管理! 下面使用的是FCKeditor.NET 2.6.3 版。1、根据当前时间设置上传目录打开FileBrowser\\Conf 阅读全文
posted @ 2011-07-12 00:51 敏捷学院 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-296.aspxc#如何取消窗体标题栏关闭using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;public class Disable{ [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr GetSystemMenu(IntPtr 阅读全文
posted @ 2011-07-12 00:47 敏捷学院 阅读(509) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-Security-Update-Windows-controls-from-another-thread.aspx// Safe update of windows control from other threadsdelegate void UpdateReportCallback(string text);private void UpdateReport(string message){ // InvokeRequired required compares the thread ID of the // calling thread t 阅读全文
posted @ 2011-07-12 00:46 敏捷学院 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-269.aspxusing System;using System.ComponentModel;using System.Windows.Forms;namespace WindowsApplication4...{ /**//// <summary> /// gui 类 /// </summary> public partial class Form1 : Form ...{ public Form1() ...{ InitializeComponent(); } private void button1_Click( 阅读全文
posted @ 2011-07-12 00:46 敏捷学院 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 标准的win32窗口程序相信熟悉windows编程的朋友,对于使用win32 api开发窗口应用程序一定不陌生。 下面的程序是从资源文件中加载一个图片并显示在窗口中。#include <windows.h>#include "resource.h"TCHAR szClassName[] = TEXT("WIN32TEST");HBITMAP hBmp;LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){PAINTSTRUCT ps;HD 阅读全文
posted @ 2011-07-12 00:45 敏捷学院 阅读(638) 评论(1) 推荐(0) 编辑
摘要: 代码下载地址:http://dev.mjxy.cn/a-The-tree-of-knowledge-development-using-ASPNET-MVC-simulation-MSDN.aspx介绍为了方便的记录所学的知识,使用知识树管理最为方便。每个节点即是数据又是父节点。登录admin,admin已经实现的功能无限制分类任意父节点改变查询节点状态(展开/收缩)记录可以扩展的功能支持程序语言的代码高亮支持附件多用户等等等等等等主界面编辑区 阅读全文
posted @ 2011-07-11 23:59 敏捷学院 阅读(432) 评论(0) 推荐(1) 编辑
摘要: 转载:http://dev.mjxy.cn/a-268.aspxfunction fnValidateMacAddress(macaddr){ var reg1 = /^[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}$/; var reg2 = /^[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A 阅读全文
posted @ 2011-07-10 13:02 敏捷学院 阅读(782) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-355.aspx// Dynamic CSS file loadingvar CSS = { load: /*static*/ function (url_, /*optional*/ media_) { // We are preventing loading a file already loaded var _links = document.getElementsByTagName("link"); if (_links.length > 0 && _links["href"] 阅读全文
posted @ 2011-07-10 13:00 敏捷学院 阅读(365) 评论(0) 推荐(0) 编辑
摘要: VS2010入门 教程 1:创建图片查看器VS2010入门 教程 2:创建迷宫VS2010入门 教程 3:创建数学测验VS2010入门 教程 4:创建匹配游戏 转载:敏捷学院技术资源库 阅读全文
posted @ 2011-07-10 12:58 敏捷学院 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 在配置文件中指定验证规则更新:2011-07-10 访问:21代码下载:http://dev.mjxy.cn/a-entlib-In-the-configuration-file-to-specify-validation-rules.aspx本演练演示如何在配置文件中使用验证规则1. 向项目中添加配置文件app.config,编译项目。2.使用配置工具配置单击 Add Type To Validate从文件添加ValidationHOL.BusinessLogic.dll 选择 Customer右键单击Customer,单击Add validation Ruleset更改Default ru 阅读全文
posted @ 2011-07-10 10:33 敏捷学院 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 代码下载:敏捷学院技术资源库本演练演示如何在资源文件中自定义验证消息1.添加资源文件,增加以下内容FirstNameMessage FirstName必须在{3}-{5}个字符LastNameMessage LastName必须在{3}-{5}个字符SSNMessage 格式必须是###-##-####{3},{5}代表验证长度的上下界。2.为属性添加自定义消息public class Customer { [StringLengthValidator(1, 25, MessageTemplateResourceType = typeof(Resources), MessageTemplate 阅读全文
posted @ 2011-07-10 08:59 敏捷学院 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 代码下载:http://dev.mjxy.cn/a-entlib-Validation-of-object-class.aspx为类添加验证属性 ObjectVaidator public class Customer { [StringLengthValidator(1, 25)] public string FirstName { get; set; } [StringLengthValidator(1, 25)] public string LastName { get; set; } [RegexValidator(@"^\d\d\d-\d\d-\d\d\d\d$" 阅读全文
posted @ 2011-07-10 08:58 敏捷学院 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 代码下载:http://dev.mjxy.cn/a-entlib-Verify-the-results-extracted.aspx本演练演示如何得到更详细的验证结果ValidationResults results = customerValidator.Validate(customer); if (!results.IsValid) { StringBuilder builder = new StringBuilder(); builder.AppendLine("Customer is not valid:"); foreach (ValidationResult 阅读全文
posted @ 2011-07-10 08:57 敏捷学院 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 代码下载:http://dev.mjxy.cn/a-entlib-Adding-Validation.aspx本演练演示:为商业实体添加验证, 启用验证实例验证。1. 为要验证的实体添加引用Microsoft.Practices.EnterpriseLibrary.Validation.dllSystem.ComponentModel.DataAnnotations2.引用命名空间using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;3.为实体属性添加验证using Microsoft.Practices.Enter 阅读全文
posted @ 2011-07-10 08:55 敏捷学院 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://dev.mjxy.cn/a-480.aspx单击行展开,在单击行的时候隐藏<html xmlns="http://www.w3.org/1999/xhtml" ><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>#</title><script src="http://ajax.googleapis.com/ajax/lib 阅读全文
posted @ 2011-07-08 17:18 敏捷学院 阅读(633) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://dev.mjxy.cn/a-JQuery-Operation-Selected.aspx/* 002文件名:jquery.liu.select.js 003功能说明:本js文件为jquery类库的一个插件,主要实现对select的操作. 004作者:John Liu 005编写日期:2008/03/12 006*/007//得到select项的个数 008jQuery.fn.size = function(){ 009return jQuery(this).get(0).options.length; 010} 011012//获得选中项的索引 013jQuery.fn 阅读全文
posted @ 2011-07-08 17:16 敏捷学院 阅读(639) 评论(0) 推荐(0) 编辑
摘要: 原文链接: http://dev.mjxy.cn/a-Form-validation-using-JQuery.aspx$(document).ready(function () { 002003/* 设置默认属性 */004$.validator.setDefaults({ 005submitHandler: function (form) { form.submit(); } 006}); 007// 中文字两个字节 008jQuery.validator.addMethod("byteRangeLength", function (value, element, pa 阅读全文
posted @ 2011-07-08 17:15 敏捷学院 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 原文链接: http://bbs.mjxy.cn/thread-63-1-1.html$(document).ready(function(e) { 02 $.getJSON("http://dev.mjxy.cn/json.aspx?n=5&jsoncallback=?",function(result){ 03 $(".devlist").empty(); 04 $.each(result, function(i,field){ 05 var html=""; 06 html="<li><a h 阅读全文
posted @ 2011-07-08 17:14 敏捷学院 阅读(201) 评论(0) 推荐(0) 编辑
摘要: http://dev.mjxy.cn/a-Ajax-call-to-remote-service.aspx$.get 方法调用webservice 处理返回结果。判断当前ip地址$.get("http://www.digitwest.com/Plus/Ip.asmx/GetAddress", function (data) { var a = $(data).find('string').text(); $('#ipdiv').html(a); }); 阅读全文
posted @ 2011-07-08 17:13 敏捷学院 阅读(643) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-401.aspxpublic abstract class BizObject { protected const int MAXROWS = int.MaxValue-1; protected static Cache Cache { get { return HttpContext.Current.Cache; } } //Cache Data protected static void CacheData(string key, object data) { if (Settings.EnableCaching && dat 阅读全文
posted @ 2011-07-08 17:10 敏捷学院 阅读(390) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-397.aspx//去左空格;function ltrim(s){return s.replace( /^\s*/, "");}//去右空格;function rtrim(s){return s.replace( /\s*$/, "");}//去左右空格;function trim(s){return rtrim(ltrim(s));}//是否为空值;function IsEmpty(_str){var tmp_str = trim(_str);return tmp_str.length == 0;}//是 阅读全文
posted @ 2011-07-08 15:38 敏捷学院 阅读(632) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-substring-from-the-right-to-obtain-the-specified-length-of-string.aspx/* Get the rightmost substring, of the specified length, from a String object.*/String.prototype.right = function (length_){ var _from = this.length - length_; if (_from < 0) _from = 0; return this.subst 阅读全文
posted @ 2011-07-08 15:37 敏捷学院 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-Javascript-Remove-control-character-from-string.aspx// Remove control character from a stringfunction removeNL(s){ // NewLine, CarriageReturn and Tab characters from a String // will be removed and will return the new string r = ""; for (i = 0; i < s.length; i++) 阅读全文
posted @ 2011-07-08 15:36 敏捷学院 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 转自: http://dev.mjxy.cn/a-169.aspxusing System;using System.Windows.Forms;using System.Drawing;using System.Drawing.Drawing2D;namespace DevDistrict.Sample{ public class GradientPanel : System.Windows.Forms.Panel { protected override void OnPaint(PaintEventArgs e) { base.OnPaint (e); Graphics g = e.Gr 阅读全文
posted @ 2011-07-08 15:34 敏捷学院 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 转自:http://dev.mjxy.cn/a-166.aspxprivate Image ScaleImage(Image source, int MaxWidth, int MaxHeight){ float MaxRatio = MaxWidth / (float) MaxHeight; float ImgRatio = source.Width / (float) source.Height; if (source.Width > MaxWidth) return new Bitmap(source, new Size(MaxWidth, (int) Math.Round(Max 阅读全文
posted @ 2011-07-08 15:32 敏捷学院 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-Create-pdf-using-Apache-NFOP.aspx//**************************************// Name: Create in memory PDF documents in ASP.NET using Apache NFOP// Description:The sample demonstrates how to create PDF documents in memory using the open source Apache NFOP(http://sourceforge.net/p 阅读全文
posted @ 2011-07-08 15:31 敏捷学院 阅读(1164) 评论(0) 推荐(0) 编辑
摘要: 转载:http://dev.mjxy.cn/a-402.aspxSystem.IO.Stream iStream = null; // Buffer to read 10K bytes in chunk: byte[] buffer = new Byte[10240]; // Length of the file: int length; // Total bytes to read: long dataToRead; // Identify the file to download including its path. string filepath = @"E:\softwar 阅读全文
posted @ 2011-07-08 15:18 敏捷学院 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 转自: http://dev.mjxy.cn/a-Download-the-file-to-stream-download-hide-the-real-path.aspx以流的方式下载文件,隐藏实际的下载路径view sourceprint?01string path = Server.MapPath("~/UploadFiles/" + "a.doc"); 02System.IO.FileInfo file = new System.IO.FileInfo(path); 0304Response.Clear(); 05Response.AddHeade 阅读全文
posted @ 2011-07-08 15:16 敏捷学院 阅读(480) 评论(0) 推荐(1) 编辑
摘要: 电子邮件正则表达式汉字验证正则表达式URL网址正则表达式电话号码正则表达式邮政编码正则表达式身份证正则表达式IP地址正则表达式数字的正则表达式字母正则表达式用户密码正则表达式空白行正则表达式HTML标记正则表达式首尾空白正则表达式帐号正则表达式日期验证正则表达式其他 阅读全文
posted @ 2011-07-08 13:44 敏捷学院 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 1DateTime thisDate1 = new DateTime(2011, 6, 10); 02Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + "."); 0304DateTimeOffset thisDate2 = new DateTimeOffset(2011, 6, 10, 15, 24, 16, 05TimeSpan.Zero); 06Console.WriteLine("The current date and tim 阅读全文
posted @ 2011-07-08 13:43 敏捷学院 阅读(228) 评论(0) 推荐(0) 编辑