- 博客(25)
- 收藏
- 关注
原创 初识 接口
using System;using System.Text;using System.IO;namespace ConsoleApplication1{ interface test { void print(string mess); string getvalue(); } class FileExample {
2008-03-27 16:12:00
639
转载 C#中获取应用程序路径的方法(集合)
string str1 =Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名。 string str2=Environment.CurrentDirectory;//获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。 //备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动,则此属性的值为驱动器名称
2008-03-21 11:28:00
8256
1
转载 DllImport 调用DLL类库
.net 框架程序可以通过静态 DLL 入口点的方式来访问本机代码库。DllImport 属性用于指定包含外部方法的实现的dll 位置。 DllImport 属性定义如下: namespace System.Runtime.InteropServices { [AttributeUsage(AttributeTargets.Method)] public class DllI
2008-03-11 15:13:00
5924
1
转载 URL重写
ASP URL重写技术,例如可以将提交的地址http://www.xxx.com/info_122.htm映射到真正的地址 http://www.xxx.com/info.asp?id=122上去,这样有利于提高GOOGLE等搜索引擎的收录率。 想要IIS支持URL重写,得先装个ISAPI 点击http://haloua.zb139.net/attachments/month_0511/
2008-03-05 13:21:00
643
原创 从一不含0的高精度正整数中去掉N个数字后按原左右次序组成一最小的数
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { long num=0;//一高精度数值
2008-02-29 15:11:00
1361
原创 从数列中抽取与某一数值(num)最接近的若干个数(n)
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { int[] arraya = new int
2008-02-29 09:04:00
1847
转载 利用HTTP_X_FORWARDED_FOR获取客户端IP(http代理的相关知识)
Request.ServerVariables变量意义. http代理相关知识Request.ServerVariables["HTTP_VIA"]---------可以获得用户内部的ipRequest.ServerVariables["HTTP_X_FORWARDED_FOR"]---------可以知道代理服务器的服务器名以及端口Request.ServerVariables["REMOTE_
2008-02-28 11:13:00
3241
原创 判断素数,各位之和为偶数
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { for (long i = 2; i
2008-02-27 15:12:00
860
原创 降序排列N个两位不重复的随机整数
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { Random rd = new Random
2008-02-27 13:34:00
840
原创 c#输出螺旋矩阵的一种拙解
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { int n=0 ; //矩
2008-02-26 17:23:00
1430
原创 ajax操作xml文件
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/1999/xhtml">Dynamically Editing Page Contentvar xmlHttp;var price1;var price2;function createXMLHttpRequest(){ if (window.Act
2007-11-26 08:09:00
892
原创 js共公函數
//實現翻頁功能function goPage(pageno) { if(document.all["pageNo"]) { document.all["pageNo"].value=pageno; form1.submit(); }}//查詢鈕功能實現function bookquery(){var questValue= showModalDialog("query.asp",windo
2007-11-26 08:07:00
930
原创 Javascript求一天數之後的日期
function cc(dd,dadd){var a = new Date(dd)a = a.valueOf()a = a - dadd * 24 * 60 * 60 * 1000a = new Date(a)alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日")}cc("2001/3/1",1
2007-11-26 08:05:00
594
原创 ASP.NET中调用存储过程
public static string GetCustomerCName(ref ArrayList arrayCName,ref ArrayList arrayID) { SqlConnection con=ADConnection.createConnection(); SqlCommand cmd=new SqlCommand("t
2007-11-26 08:03:00
547
原创 C#數據庫訪問
using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient; namespace DatabaseOperate{ class SqlOperateInfo { //Suppose your ServerName
2007-11-26 08:02:00
581
原创 ajax
function barsave(strbarname){ var io_type=document.all("Dro_iotype").value; var BCode=jsTrim(document.all(strbarname).value); var io_datetime=document.all("Txt_IO_date").value; if(window.e
2007-11-24 16:08:00
520
原创 AutoCompleteExtender實例
頁面代碼http://www.w3.org/1999/xhtml">自動完成查數據表 MinimumPrefixLength="1" ServiceMethod="GetUsers" CompletionSetCount="8" CompletionInterval="10" EnableCaching="true
2007-11-24 15:58:00
1526
3
转载 委托的故事
从前,在南方一块奇异的土地上,有个工人名叫彼得,他非常勤奋,对他的老板总是百依百顺。但是他的老板是个吝啬的人,从不信任别人,坚决要求随时知道彼得的工作进度,以防止他偷懒。但是彼得又不想让老板呆在他的办公室里站在背后盯着他,于是就对老板做出承诺:无论何时,只要我的工作取得了一点进展我都会及时让你知道。彼得通过周期性地使用“带类型的引用”(原文为:“typed reference” 也就是delega
2007-11-24 15:48:00
581
转载 JavaScript使用面向对象的技术创建高级 Web 应用程序
最近,我面试了一个有五年 Web 应用程序开发经验的软件开发人员。四年半来她一直在从事 JavaScript 相关的工作,她自认为 JavaScript 技能非常好,但在不久之后我就发现实际上她对 JavaScript 知之甚少。话虽这样说,但我确实没有责备她的意思。JavaScript 真的是很有趣。很多人(包括我自己,直到最近!)都认为自己很擅长 JavaScript 语言,因为他们都知道 C
2007-11-24 15:44:00
524
转载 猴子分桃與海盜分金幣
2.(智力题)5个猴子抢得100个桃子后,讨论如何进行公正分配。他们商定的分配原则是: (1)抽签确定各自的分配顺序号码(1,2,3,4,5); (2)由抽到1号签的猴子提出分配方案,然后5个进行表决,如果方案得到超过半数的同意,就按照他的方案进行分配,否则就将1号扔进大海喂鲨鱼; (3)如果1号被扔进大海,则由2号提出分配方案,然后由剩余的4人进行表决,当且仅当超过半数的同意时,才会
2007-11-24 15:38:00
1208
原创 處理.net xmlhttp異步
最近正在拜读>这本书,运用书中知识,结合.net,写了这篇用.net 处理xmlHttp发送异步请求的文章。 我们要达到的目的是点击按钮,获得服务器的当前时间,aspx的html如下:Htmlhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml" > 测试
2007-11-24 15:37:00
645
转载 AJAX 调用Web Service 与 PageMethods注意细节
想要使用ASP.NET AJAX在客户端JavaScript中异步调用服务器端Web Service,我们需要:1 为Web Service类或需要暴露给客户端的Web Service方法添加[ScriptService] 属性; 2 为Web Service中需要暴露给客户端的方法添加[WebMethod]属性;3 在页面中的ScriptManager控件中添加对该We
2007-11-24 15:35:00
773
转载 C#對話框操作
常用对话框有:1、文件对话框(FileDialog) 它又常用到两个: 打开文件对话框(OpenFileDialog) 保存文件对话(SaveFileDialog)2、字体对话框(FontDialog)3、颜色对话框(ColorDialog)4、打印预浏对话框(PrintPreviewDialog)5、页面设置(PrintDialog)6、打印对话框(PrintDialog)一、打开文件对
2007-11-24 15:32:00
1178
原创 委托的一個示例
一.using System;using System.Collections.Generic;using System.Text;namespace Delegate{ // 热水器 public class Heater { private int temperature; public delegate void BoilHandler(i
2007-11-24 15:28:00
459
原创 套打页面(轉)
用到WEB打印这方面内容,没想中间遇到很多问题,曾在网上找过许多解决方案,有些控件但是国内的基本都是需要注册收费的,只有国外的一个ScriptX是免费的,看到许多人用,但这个控件被IE等众多的安全工具所困扰,常常需要设置一堆东西,对于电脑水平不是很高客户来说确实很麻烦,不过我也只用它去掉了IE打印的页眉页脚,打印还是用的IE的WEBBROWSER,不说费话了,下面先介绍一下我思路。
2007-11-24 15:16:00
1121
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人