摘要: using System;using System.Collections.Generic;using System.Text;namespace NET.MST.Sixth.TraFactory{ /// <summary> /// 使用者 /// </summary> class Customer { static void Main(string[] args) { //根据需要获得不同的产品零件 IProduct window = FactoryManager.GetProduct(RoomParts.Window); IProduct roof = Facto 阅读全文
posted @ 2011-06-24 15:09 brainmao 阅读(387) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;namespace NET.MST.Fifth.UseFileInfo{ class UseFileInfo { static void Main(string[] args) { ProcessFile(); Console.Read(); } //操作文件的功能 static void ProcessFile() { FileInfo info = null; FileInfo newinfo = null; try { //创建文 阅读全文
posted @ 2011-06-19 18:08 brainmao 阅读(815) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;namespace NET.MST.Fifth.UseDirectoryInfo{ class UseDirectoryInfo { static void Main(string[] args) { ProcessDirectory(); Console.Read(); } //操作文件夹的功能 static void ProcessDirectory() { DirectoryInfo di = null; try { //创建文件 阅读全文
posted @ 2011-06-15 22:17 brainmao 阅读(243) 评论(1) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;namespace NET.MST.Third.FinalizeDispose{ public class FinalizeDisposeBase : IDisposable { // 标记对象是否已被释放 private bool _disposed = false; // Finalize方法: ~FinalizeDisposeBase() { Dispose(false); } // 这里实现了IDispose中的 Dispose方法 public void D 阅读全文
posted @ 2011-06-13 17:52 brainmao 阅读(280) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.Reflection.Emit;using System.Threading;using System.Reflection;namespace NET.MST.Sixth.EmitAssembly{ class MainClass { /// <summary> /// 使用发射的类型 /// </summary> /// <param name="args"></param&g 阅读全文
posted @ 2011-06-11 22:31 brainmao 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 最近看优酷的视频,有时视频本身只有5秒钟,广告30多秒,甚是不爽,今日觅得此等良法,与大家共享。一、打开 C:\Windows\System32\drivers\etc 这个文件夹,里面有一个文件名为“hosts”的文件,无扩展名,右键——打开,用记事本打开它。二、打开后,在文本最后,空一行,添加以下内容:127.0.0.1 atm.youku.com127.0.0.1 Fvid.atm.youku.com127.0.0.1 html.atm.youku.com127.0.0.1 valb.atm.youku.com127.0.0.1 valf.atm.youku.com127.0.0.1 v 阅读全文
posted @ 2011-06-10 14:04 brainmao 阅读(1729) 评论(0) 推荐(1) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;namespace NET.MST.Fourth.Base64{ class NET.MST.Fourth.Base64 { static void Main(string[] args) { String abc = "abcde"; //生成UTF8字节数组 Byte[] bytes = Encoding.UTF8.GetBytes(abc); //转换成Base64字符串 String base64 = BytesToBase64(bytes 阅读全文
posted @ 2011-06-10 10:37 brainmao 阅读(7838) 评论(0) 推荐(0) 编辑
摘要: import java.io.IOException;import java.io.PrintWriter;import java.util.HashSet;import java.util.Random;import java.util.Set;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;public cl 阅读全文
posted @ 2011-06-09 21:32 brainmao 阅读(1255) 评论(0) 推荐(0) 编辑
摘要: 最近致力于一个小型的供求信息门户网站的开发设计,小小草图,和大家分享下前台功能结构:后台初步草稿业务流程数据库的设计正在调整,项目适合练手,主要还是设计模式... 阅读全文
posted @ 2011-06-09 09:55 brainmao 阅读(247) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Threading;namespace NET.MST.Seventh.ThreadDataSlot{ class MainClass { /// <summary> /// 测试数据插槽 /// </summary> static void Main() { Console.WriteLine("现在开始测试数据插槽"); //开辟五个线程来同时运行 //这里不适合用线程池, //因为线程池内的线程会被反复使用 //导致线程ID一致 for (int i = 0; i < 5; i++) { 阅读全文
posted @ 2011-06-06 21:18 brainmao 阅读(690) 评论(0) 推荐(0) 编辑