摘要: 一、基于xfire发布的webservice获取客户端ip的方法 public String getClientIp(){ String ip = ""; try { HttpServletRequest request = XFireServletController.getRequest(); ip = request.getRemoteAddr(); System.out.println("客户端ip=:"+ip); } catch (Exception e) { System.out.println("无法获取HttpServletRe 阅读全文
posted @ 2012-06-21 11:23 cotty 阅读(2800) 评论(0) 推荐(0) 编辑
摘要: Java代码 <strong>1.基于jax-ws开发的webservice获取客户端ip的方法【在代理类XXXDelegate添加如下代码】:</strong> import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.xml.ws.WebServiceContext; import javax.xml.ws.handler.MessageContext; @Resource private WebServ... 阅读全文
posted @ 2012-06-21 11:21 cotty 阅读(611) 评论(0) 推荐(0) 编辑
摘要: 在C#.net中如何操作XML需要添加的命名空间:using System.Xml;定义几个公共对象:XmlDocument xmldoc ;XmlNode xmlnode ;XmlElement xmlelem ;1,创建到服务器同名目录下的xml文件:方法一:xmldoc = new XmlDocument ( ) ;//加入XML的声明段落,<?xml version="1.0" encoding="gb2312"?>XmlDeclaration xmldecl; xmldecl = xmldoc.CreateXmlDeclaratio 阅读全文
posted @ 2012-06-19 10:34 cotty 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 名人名言:每个人在他生活中都经历过不幸和痛苦。有些人在苦难中只想到自己,他就悲观消极发出绝望的哀号;有些人在苦难中还想到别人,想到集体,想到祖先和子孙,想到祖国和全人类,他就得到乐观和自信。——洗星海Visual Studio 中提供了浏览器控件 WebBrowser, 可以用在 WinForm 中充当一个小型的浏览器.WebBrowser 本身提供了调用页面中 js 函数的方法, 但没有直接提供可以添加执行新的 js 脚本的功能. 如果有如下的 js 函数:1 <script type="text/javascript">2 function add(num1 阅读全文
posted @ 2012-05-25 12:08 cotty 阅读(1492) 评论(0) 推荐(0) 编辑
摘要: 简单介绍下它的用法:一.AjaxPro的使用 1.在项目中添加引用,浏览找到AjaxPro.2.dll文件2.在Web.config中的system.web里面写入以下代码 </configuration><system.web> <httpHandlers> <add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/> </httpHandlers></system.web>& 阅读全文
posted @ 2012-05-22 16:55 cotty 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 用C#如何创建、读取cookie:一、创建cookie,并写入数据: //创建、写入Cookie HttpCookie cookie = Request.Cookies["MWS_User"]; if (cookie == null) { cookie = new HttpCookie("MWS_User"); } cookie.Values.Set("UserID", strUserID); Response.SetCookie(cookie);二、读取cookie:HttpCookie cookie = Request.Cooki 阅读全文
posted @ 2012-05-04 09:00 cotty 阅读(608) 评论(0) 推荐(0) 编辑
摘要: 方法一:1、首先建立一个按钮,在后台将调用或处理的内容写入button_click中;2、在前台写一个js函数,内容为document.getElementById("btn1").click();3、在前台或后台调用js函数,激发click事件,等于访问后台c#函数;方法二:1、函数声明为public 后台代码(把public改成protected也可以)public string ss(){return("a");}2、在html里用<%=fucntion()%>可以调用前台脚本<script language=javascript>var a = 阅读全文
posted @ 2012-04-14 09:51 cotty 阅读(315) 评论(0) 推荐(0) 编辑
摘要: <SCRIPT LANGUAGE="JavaScript"> <!-- String.prototype.Trim =function() { returnthis.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.LTrim =function() { returnthis.replace(/(^\s*)/g, ""); } String.prototype.RTrim =function() { returnthis.replace(/(\s*$)/g, &quo 阅读全文
posted @ 2012-04-13 09:00 cotty 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 一、目前在ASP.NET中页面传值共有这么几种方式:1、表单提交, <form action= "target.aspx" method = "post" name = "form1"><input name = "param1" value = "1111"/><input name = "param2" value = "2222"/> </form> .... form1.submit(); .... 阅读全文
posted @ 2012-04-11 20:46 cotty 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 一、引用ICSharpCode.SharpZipLib.dlls下载地址 http://www.icsharpcode.net/OpenSource/SharpZipLib/二、获取含有要打包文件名信息格式解释:DirFullPath:目录,在哪个文件夹里选择文件SearchPattern:搜索条件:比如*.doc 选择所有doc格式的文件fncountent:文件名列表 只单纯的名字 如:ee.txt 只是ee名字spublic static List<string> GetDirFiles(string DirFullPath, string SearchPattern, Li 阅读全文
posted @ 2012-03-30 11:53 cotty 阅读(975) 评论(1) 推荐(0) 编辑