摘要:
function jsChecking(strTxt, minLength, maxLength, strRegular) { if (strTxt == null) { strTxt = ""; } if (!(strTxt.length >= minLength && strTxt.length <= maxLength)) { return "字段长度不再允许范围内,允许输入长度为(" + minLength + "-" + maxLength + ")"; } else if (
阅读全文
posted @ 2013-05-11 17:52
王洪洪
阅读(215)
推荐(0)
摘要:
一、服务器与浏览器// 取得本机的loopback网络地址,即127.0.0.1 IPAddress address = IPAddress.Loopback; IPEndPoint endPoint = new IPEndPoint(address, 49152); Socket socket =...
阅读全文
posted @ 2013-05-11 08:51
王洪洪
阅读(443)
推荐(0)
摘要:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&qu
阅读全文
posted @ 2013-05-10 21:01
王洪洪
阅读(463)
推荐(0)
摘要:
public static void WriteErrorLogDataInteraction(string sLog, string titleLog) { try { string logPath = ConfigurationSettings.AppSettings["LogPath"]; //通过配置文件记录错误日志位置 if (string.IsNullOrEmpty(logPath)) { logPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;//配置文件安装目录 }
阅读全文
posted @ 2013-05-10 16:01
王洪洪
阅读(217)
推荐(0)
摘要:
/// <summary> /// 把数据插入到Excel表中 /// </summary> /// <param name="sql">Sql语句</param> /// <param name="Tablename">sheet名或者表名</param> /// <returns></returns> public void InsertDataToExcel() { object missing = Sys...
阅读全文
posted @ 2013-04-28 15:59
王洪洪
阅读(553)
推荐(0)
摘要:
Helperusing System;using System.Collections.Specialized;using System.Configuration;using System.Data;using System.Data.Common;using System.Data.SqlClient;using Microsoft.Practices.EnterpriseLibrary.Data;using Microsoft.Practices.EnterpriseLibrary.Data.Sql;/* * 作 者: zjf * 创建时间: 2013-1-29 10:20:53 *..
阅读全文
posted @ 2013-04-28 15:52
王洪洪
阅读(227)
推荐(0)
摘要:
实现功能:去一个url抓取页面,在页面的内容里面在去找另一个url。找到这个这url之后经过一系列操作后再去重组的url去抓取内容。第一、写出c#抓取页面的代码c#抓取页面 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.IO; 6 using System.Net; 7 using System.Text; 8 9 /// <summary> 10 ///abc 的摘要说明 11 /// </summary.
阅读全文
posted @ 2013-04-28 14:15
王洪洪
阅读(434)
推荐(0)
摘要:
在做wcf时,需要得到客户端的ip。一开始用了几种方法总是不好使。后来在网上找到这个方法可以正确的获得客户端的ip了。 [OperationContract] public static string GetClientIp() { string result = String.Empty; result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (result != null && result != String.Empty) { //可¨
阅读全文
posted @ 2013-04-10 15:56
王洪洪
阅读(340)
推荐(0)
摘要:
一、什么是WebService?为什么需要WebService?WebService是两个计算机之间通讯(交谈)的技术,网络中一台计算机想要调用另一台计算机的方法时,此时可以需要WebService。很火的SOA、云计算在技术层面上都是WebService二、自己做一个WebService例子:服务器端添加一个ashx页面代码如下 public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; try { int Number1 = int.Pars
阅读全文
posted @ 2013-02-04 10:24
王洪洪
阅读(4579)
推荐(2)
摘要:
一、学习Web Forms之路 近来总是去官网http://www.asp.net/上去看,想找一个适合asp.net学习的实例。后来发现了一个觉得不错就是petshop。PetShop是一个小型的项目,系统架构与代码都比较简单,却也凸现了许多颇有价值的设计与开发理念。 1、PetShop的系统架构设计 在软件体系架构设计中,分层式结构是最常见,也是最重要的一种结构。微软推荐的分层式结构一般分为三层,从下至上分别为:数据访问层、业务逻辑层(又或成为领域层)、表示层. 2、PetShop引入了缓存和异步处理机制和MemberShip。 所以如果想了解一下三层框架、缓存、MemberS...
阅读全文
posted @ 2013-01-31 09:30
王洪洪
阅读(375)
推荐(0)