随笔分类 - ASP.NET
摘要:效果图:源码下载:http://download.csdn.net/detail/a497785609/5495951
阅读全文
摘要:using System;using System.Globalization;using System.Web.UI;namespace WebApplication1{ public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) { string test = ""; test += "Request.ServerVariables[\"LOCAL_ADDR\"]:" + Reques...
阅读全文
摘要:using System;
using System.Globalization;
using System.IO;
using System.Security;
using System.Security.Cryptography;
using System.Text;
using System.Xml;
using System.Xml.Serialization; namespace Helper
{ /// <summary> /// 配置文件辅助类 /// </summary> public class ConfigHelper {
...
阅读全文
摘要:工作原理: 通过程序代码模拟用户登陆,并发布文章。目前需要使用者手动输入Cookie。 下载地址程序界面:使用方法:懒得描述了,都截图说明吧。这里说下如何获取Cookie:(以firebug为例,用finder就更直观了)1.进入csdn登陆页面,开启firebug,插入js断点:2.查看请求网络数据包:注意:是请求头信息里的Cookie。3.查看Cookie,并复制保存:4.将获取到的Cookie填入客户端程序:5.初始化文章分类:6.至此结束,发表文章即可!
阅读全文
摘要:功能简介:实现客户端编写博文功能。下载地址程序界面:工作原理: 通过程序代码模拟用户登陆,并模拟Post请求以发布文章。下载地址=======================================================更新记录============================================================2013-5-5 更新:增加富文本编辑器。2013-5-5 更新:解决需手动输入cookie的问题,登录失败时再手动输入cookie吧,获取cookie的方法,见下文。(ps:若直接能登录账户,下面内容可忽略)使用方法:截图说明吧..
阅读全文
摘要:字符串“2013/4/19 14:33:26”不是有效的 AllXsd 值。说明:执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.FormatException: 字符串“2013/4/19 14:33:26”不是有效的 AllXsd 值。Xml反序列化时,时间格式的数据会出现问题。解决办法:public string GetObjectXml(string sql, string conn, string className) { var objXml = new StringB...
阅读全文
摘要:目前仍处于功能开发阶段,在线预览:http://zhangqs008.atx41.idc800.net/admin/index.htm
阅读全文
摘要:目前仍处于功能开发阶段,在线预览:http://zhangqs008.atx41.idc800.net/Default.aspx
阅读全文
摘要:我们在做网页的时候,会遇到一个图片和文字位置对不齐的问题.虽然解决的办法有很多.比如.用table来控制图片和文字居中对齐(这样会因为一个小图片写多很多代码)使用图片的Align属性设置为align="absmiddle"(但是要知道,标准的W3C中定义的img标签是不支持Align属性的)以上的方法都不是解决问题最好的办法.后来无意中发现可以用CSS来解决这个问题.一个关键的属性:margin-bottom通过修改图片的外边框的底部高度就可以让文字移动上来.做法是把这个值设置为负数.例如我们把下面的16X15的图片设置它的style="margin-bottom
阅读全文
摘要:try { const string ip138ComIcAsp = "http://iframe.ip138.com/ic.asp"; //查询IP138得到您当前的外网IP var uri = new Uri(ip138ComIcAsp); WebRequest wr = WebRequest.Create(uri); Stream stream = wr.GetResponse().GetResponseStream();
...
阅读全文
摘要:using System;
using System.Net;
using System.Text;
using System.Text.RegularExpressions; internal class Program
{ // 获取网页的HTML内容,根据网页的charset自动判断Encoding public static string GetHtml(string url) { return GetHtml(url, null); } // 获取网页的HTML内容,指定Encoding private static...
阅读全文
摘要:http://msdn.microsoft.com/zh-cn/library/wyts434y(v=vs.80).aspx
阅读全文
摘要:AspCompat is an aid in migrating ASP pages to ASPX pages. It defaults to false but should be set to true in any ASPX file that creates apartment-threaded COM objects--that is, COM objects registered ThreadingModel=Apartment. That includes all COM objects written with Visual Basic 6.0. AspCompa...
阅读全文
摘要:在C#中有HttpWebRequest类,可以很方便用来获取http请求,但是这个类对Post方式没有提供一个很方便的方法来获取数据。网上 有很多人提供了解决方法,但都参差不齐,这里我把我使用的方法总结出来,与大家分享。本文精华:实现了post的 时候即可以有字符串的key-value,还可以带文件。Post数据格式Post提交数 据的时候最重要就是把Key-Value的数据放到http请求流中,而HttpWebRequest没有提供一个属性之类的东西可以让我们自由添加 Key-Value,因此就必须手工构造这个数据。根据RFC 2045协议,一个Http Post的数据格式如下:Conten
阅读全文
摘要:效果图:HTML源文件:<html> <body> <div> <div id="title"> <h1>Javascript加密解密工具</h1> </div> <div id="wrapper"> <script type="text/javascript"> // <![CDATA[ a = 62; ...
阅读全文
摘要:http://jsbeautifier.org/
阅读全文
摘要:本文仅提供通过设置SoapHeader来控制非法用户对WebService的调用,如果是WebService建议使用WSE3.0来保护Web服务,如果使用的是Viaual Studio 2008可以使用WCF,WCF里面提供了更多的服务认证方法。以下提供一种基于SoapHeader的自定义验证方式。1.首先要自定义SoapHeader,须继承System.Web.Services.Protocols.SoapHeader。using System;
using System.Collections.Generic;
using System.Web; /// <summary>
/
阅读全文
摘要:用C#输出日历,此功能可用于Ajax方式列出计划日程相关的内容,由于是C#控制输出,可以方便加上自己需要的业务处理逻辑。1.控制台输出:using System; namespace 控制台日历
{ class Program { public static void Main(string[] args) { string s = " "; Console.WriteLine("输入年份:"); int nYear = int.Parse(Console.ReadLine()); Console.WriteLine("输入月份:")
阅读全文
摘要:原理很简单,解析程序集生成时的xml描述文档。设置生成程序集时生成xml描述文档的操作如下:程序界面:生成后的文档视图(样式调整需改源码)关键代码: /// <summary> /// 生成HTML说明文档 /// </summary> /// <param name="filePath">文件路径</param> public void GenneralHtmlDocument(string filePath) { XmlDocument doc = new XmlDocum...
阅读全文
摘要:Question: WebService部署成站点之后,如果在本地测试webservice可以运行,在远程却显示“测试窗体只能用于来自本地计算机的请求”或者"The test form is only available for requests from the local machine. ",Reason: 那是因为没有开启远程访问的原因。Solutions:在web.config的<system.web></system.web>中间加入如下配置节内容<webServices> <protocols> <add
阅读全文