2011年11月28日

asp.net夜话之十一:web.config详解

摘要: 在开发中经常会遇到这样的情况,在部署程序时为了保密起见并不将源代码随项目一同发布,而我们开发时的环境与部署环境可能不一致(比如数据库不一样),如果在代码中保存这些配置这些信息部署时需要到用户那里更改代码再重新编译,这种部署方式非常麻烦。在.net中提供了一种便捷的保存项目配置信息的办法,那就是利用配置文件,配置文件的文件后缀一般是.config,在asp.net中配置文件名一般默认是web.config。每个web.config文件都是基于XML的文本文件,并且可以保存到Web应用程序中的任何目录中。在发布Web应用程序时web.config文件并不编译进dll文件中。如果将来客户端发生了变化 阅读全文

posted @ 2011-11-28 21:47 缘从心开始 阅读(196) 评论(0) 推荐(0) 编辑

web.config文件详解

摘要: 阅读全文

posted @ 2011-11-28 21:44 缘从心开始 阅读(186) 评论(0) 推荐(0) 编辑

数据源最快导入方法

摘要: using System.Data.SqlClient;using System;class Program{ static void Main() { string connectionString = GetConnectionString(); using (SqlConnection sourceConnection = new SqlConnection(connectionString)) { sourceConnection.Open(); Sql... 阅读全文

posted @ 2011-11-28 21:42 缘从心开始 阅读(325) 评论(0) 推荐(0) 编辑

C#获取MAC地址

摘要: ///<summary> /// 获得MAC地址 ///</summary> ///<returns></returns> public static string[] GetMacAddress() { ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection moc = mc.GetInstances(); ... 阅读全文

posted @ 2011-11-28 21:39 缘从心开始 阅读(264) 评论(0) 推荐(0) 编辑

WinForm 只允许打开一个程序

摘要: using System;using System.Collections.Generic;using System.Windows.Forms;namespace Dachie{ static class Program { ///<summary> /// The main entry point for the application. ///</summary> [STAThread] static void Main() { Application.EnableVis... 阅读全文

posted @ 2011-11-28 17:40 缘从心开始 阅读(201) 评论(0) 推荐(0) 编辑

C# UDP 发送 接收

摘要: using System;using System.Collections.Generic;using System.Text;using System.Net;using System.Net.Sockets;namespace Dachie{ class Program { static void Main(string[] args) { } } public class MessageUtility { //缺省端口号 private const int DEFA... 阅读全文

posted @ 2011-11-28 17:39 缘从心开始 阅读(479) 评论(0) 推荐(0) 编辑

C# 下载文件 winform

摘要: ///<summary> /// 下载文件 ///</summary> ///<param name="URL">下载文件地址</param> ///<param name="Filename">下载后的存放地址</param> ///<param name="Prog">用于显示的进度条</param> public void DownloadFile(string URL, string filename, System.Windows 阅读全文

posted @ 2011-11-28 17:38 缘从心开始 阅读(389) 评论(0) 推荐(0) 编辑

Windows API函数大全

摘要: 1. API之网络函数WNetAddConnection 创建同一个网络资源的永久性连接WNetAddConnection2 创建同一个网络资源的连接WNetAddConnection3 创建同一个网络资源的连接WNetCancelConnection 结束一个网络连接WNetCancelConnection2 结束一个网络连接WNetCloseEnum 结束一次枚举操作WNetConnectionDialog 启动一个标准对话框,以便建立同网络资源的连接WNetDisconnectDialog 启动一个标准对话框,以便断开同网络资源的连接WNetEnumResource 枚举网络资源WNet 阅读全文

posted @ 2011-11-28 17:35 缘从心开始 阅读(175) 评论(0) 推荐(0) 编辑

用c#读写ini文件

摘要: using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Runtime.InteropServices;using System.IO;using System.Text;namespace ex84_readWriteIni{/// <summary>/// Form1 的摘要说明。////// zhanghua 2005-7-28////// &l 阅读全文

posted @ 2011-11-28 17:33 缘从心开始 阅读(197) 评论(0) 推荐(0) 编辑

C#中使用Split分隔字符串的技巧

摘要: 在分割字符串的时候我们常常会用到Split,下面我们就来学习一下分割字符串的技巧和方法。1、使用String.Split单字符分割String.Split方法命名空间:System程序集:mscorlib(在 mscorlib.dll 中)返回的字符串数组包含此实例中的子字符串(由指定字符串或 Unicode 字符数组的元素分隔)。Split(Char[])返回的字符串数组包含此实例中的子字符串(由指定 Unicode 字符数组的元素分隔)。Split(Char[], Int32)返回的字符串数组包含此实例中的子字符串(由指定 Unicode 字符数组的元素分隔)。参数指定返回的子字符串的最大 阅读全文

posted @ 2011-11-28 17:32 缘从心开始 阅读(1193) 评论(0) 推荐(0) 编辑

C# .NET中如何使用GetCursorPos函数

摘要: 标签:getcursorpos鼠标编程屏幕取词it分类:编程技法5月22日用Mouse_event()来控制鼠标操作在自动化测试的开发中,有一些控件的ID是很难找到的,所以有些时候,我们直接设置鼠标的位置,然后是用click事件,会收到很好的效果。在Windows API中有个mouse_event函数为我们准备好了这一切。这个函数在user32.dll这个库文件里面。我们可以在C:/WINDOWS/system32(XP系统)这个目录下找到这个文件,他是系统自带的。 我们以C#直接调用这个文件中的API为例子来说下怎么进行鼠标操作,首先在我们C#中声明引用,如果是一个基于From的程序,这个 阅读全文

posted @ 2011-11-28 17:31 缘从心开始 阅读(6089) 评论(0) 推荐(0) 编辑

C#中使用 SendMessage 向非顶端窗体发送组合键

摘要: 开门见山,不废话了, 直接举例说明一下:比如发送ALT + F以下是 用spy++截取的消息内容<00001> 000310DC P WM_SYSKEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:0 fAltDown:1 fRepeat:0 fUp:0<00002> 000310DC P WM_SYSKEYDOWN nVirtKey:'F' cRepeat:1 ScanCode:21 fExtended:0 fAltDown:1 fRepeat:0 fUp:0<00003> 00 阅读全文

posted @ 2011-11-28 17:30 缘从心开始 阅读(400) 评论(0) 推荐(0) 编辑

WinForm 修改Internet选项安全属性

摘要: using System;using Microsoft.Win32;using System.Diagnostics;public class ChangProxy{ public static void Main(string[] args) { int Proxy_Enabled; RegistryKey rkey = Registry.CurrentUser; RegistryKey software = rkey.OpenSubKey("Software"); RegistryKey microsoft = software.OpenSubKey("Mi 阅读全文

posted @ 2011-11-28 17:29 缘从心开始 阅读(1038) 评论(0) 推荐(0) 编辑

C# WebBrowser实现网页自动填表

摘要: 阅读全文

posted @ 2011-11-28 17:28 缘从心开始 阅读(472) 评论(0) 推荐(0) 编辑

HTML字符实体(Character Entities),转义字符串(Escape Sequence)

摘要: HTML字符实体(Character Entities),转义字符串(Escape Sequence)为什么要用转义字符串?HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用。这些符号是不显示在我们最终看到的网页里的,那如果我们希望在网页中显示这些符号,该怎么办呢?这就要说到HTML转义字符串(Escape Sequence)了。转义字符串(Escape Sequence)也称字符实体(Character Entity)。在HTML中,定义转义字符串的原因有两个:第一个原因是像“<”和“>”这类符号已经用来表示H 阅读全文

posted @ 2011-11-28 17:27 缘从心开始 阅读(182) 评论(0) 推荐(0) 编辑

JavaScript/HTML格式化

摘要: http://tool.chinaz.com/Tools/JsFormat.aspx 阅读全文

posted @ 2011-11-28 17:26 缘从心开始 阅读(131) 评论(0) 推荐(0) 编辑

网页复制保留版权JS

摘要: 网页复制保留版权JSdocument.body.oncopy=function(){ event.returnValue=false; var t=document.selection.createRange().text; var s="\r\n本文来源于 XXX-方向比努力更重要 http://dachie.cnblogs.com \r\n 转载请保留版权"; clipboardData.setData('Text','\r\n'+t+'\r\n'+s+'\r\n');}把以上javascript代码 放到 阅读全文

posted @ 2011-11-28 17:23 缘从心开始 阅读(223) 评论(0) 推荐(0) 编辑

Js 过滤空格

摘要: JS 过滤空格<SCRIPT LANGUAGE="JavaScript">function ignoreSpaces(string) {var temp = "";string = '' + string;splitstring = string.split("");for(i = 0; i < splitstring.length; i++)temp += splitstring[i];return temp;}</script><font size="2"&g 阅读全文

posted @ 2011-11-28 17:12 缘从心开始 阅读(329) 评论(0) 推荐(0) 编辑

ezj.ext.editor

摘要: ezj.ext.editorHTML 代码<textareaid="content1"name="content1"style="width:100%;height:200px;"><p><imgborder="0"alt=""align="left"src="http://kindsoft.net/images/logo_180_30.gif"/>KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网 阅读全文

posted @ 2011-11-28 17:07 缘从心开始 阅读(252) 评论(0) 推荐(0) 编辑

onbeforeunload-离开网页前提示(确认)

摘要: 很幸运,在 IE、Firefox、Chrome 等浏览器中均支持。window.onbeforeunload = function() { return "文章还没有保存,您确定退出吗?";// return 这句必不可少}把上述 JavaScript 代码插入网页后,前进、后退、刷新、访问新的网址、关闭窗口……时,将会得到提示。IE 中的提示英文版 Firefox 中的提示Chrome 中的提示取消根据我们的应用,可能是某些情况下(比如文章没有保存)退出需要提示,但某些情况下(比如文章已经保存)就不需要提示了,此时将 window.onbeforeunload 设置为 n 阅读全文

posted @ 2011-11-28 17:06 缘从心开始 阅读(560) 评论(0) 推荐(0) 编辑

导航

文章作者:(Super)
文章出处:http://www.cnblogs.com/superai
欢迎转载,转载时请注明出处。谢谢合作。