- 浏览: 41252 次
最新评论
-
Hey_L:
很详细 受用了
百度云推送(Java实现)
文章列表
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Util
{
public class RegexUtil
{
private RegexUtil() { }
private static RegexUtil instance = null;
/// ...
- 2013-12-06 14:06
- 浏览 543
- 评论(0)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Util
{
public class MD5
{
public static string MD5Encrypt(string str)
{
return MD5Encrypt(str, 16);
}
public static string MD5Encrypt(string strSource, ...
- 2013-12-06 13:53
- 浏览 417
- 评论(0)
配置文件中的URL配置
<appSettings>
<add key="rootURL" value="http://192.168.0.150:51898/"/>
</appSettings>
正则替换的方法
public string changeURL(object url)
{
string oldURL = Convert.ToString(url);
string rootAppURL = System.Configuration.Co ...
- 2013-12-05 21:16
- 浏览 380
- 评论(0)
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Drawing;
using System.Drawing.Drawing2D; //在System.Drawing.dll中
using System.Drawing.Imaging; //在System.Drawing.dll中
namespace Util
{
public class ImageUtil
{
#region 正方型裁剪并缩放
...
- 2013-12-03 22:46
- 浏览 519
- 评论(0)
封装好的对象:
var Ajax = function (sUrl, sMethod, oParam, fCallback) {
this.sUrl = sUrl;
this.sMethod = sMethod;
this.oParam = oParam;
this.fCallback = fCallback;
this.status = {
1: '请求成功',
2: 'http返回失败',
3: '数据加载中'
}
this.xmlHttp = null;
//驱动函数
...
- 2013-12-03 20:52
- 浏览 410
- 评论(0)
var xmlhttp = null;
function myajax() {
//1、创建XMLHttpRequest对象
//2、需要针对IE和其它浏览器建立这个对象的不同方式写不同的代码
if (window.XMLHttpRequest) {
//针对FF,Mozilar,Opera,Safari,IE7,IE8
xmlhttp = new XMLHttpRequest();
//修正某些浏览器bug
if (xmlhttp.overrideMimeType) {
xmlhtt ...
- 2013-12-03 20:45
- 浏览 376
- 评论(0)
public static string GetRootURI()
{
string AppPath = "";
HttpContext HttpCurrent = HttpContext.Current;
HttpRequest Req;
if (HttpCurrent != null)
{
Req = HttpCurrent.Request;
string UrlAuthority = Req.Url.GetLeftPart(UriPa ...
- 2013-12-03 11:17
- 浏览 580
- 评论(0)
页面后台cs文件的相对网站根目录的路径/view/Atlas
string rootPath1= Server.MapPath("~");
string rootPath2 = Request.ApplicationPath;
string path1 = Server.MapPath("upload");
string path2 = Server.MapPath("");
string path3 = Server.MapPath(".");
string path4 = Server.MapPath(&quo ...
- 2013-12-03 10:43
- 浏览 320
- 评论(0)
打开[我的文档]\IISExpress\config\applicationhost.config
找到下面的代码块
在 <bindings></bindings>中仿照
<binding protocol="http" bindingInformation="*:51898:localhost" />
把localhost改为你的ip地址,改完后效果如下:
<site name="Web" id="13">
<applicatio ...
- 2013-12-02 20:37
- 浏览 928
- 评论(0)
后台添加Confirm
for (int i = 0; i < GridView1.Rows.Count; i++)
{
LinkButton LinkDel = (LinkButton)GridView1.Rows[i].FindControl("LinkDel");
LinkDel.Attributes.Add("onclick", "return confirm('你要执行这个操作吗?');");
}
全 ...
- 2013-12-02 16:55
- 浏览 342
- 评论(0)
一般弹窗
Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "alert('确定删除吗')", true);第一个参数不会变,
第二个参数是键值的意思,如果只有一个弹出对话框的语句可以不写,多个的话,最好写上,名字自己定义,不能同名
第三个参数是js代码的内容,可以是已定义方法的方法名
第四个参数如果为true的话,那么第三个参数就可以不用加<script></script>标签了,如果为false 则必需加上
或者直接在页面上写入 ...
- 2013-12-02 14:28
- 浏览 517
- 评论(0)
Json.NET
Json.NET下载地址:http://json.codeplex.com/
①添加引用
using Newtonsoft.Json;②调用方法
string jsonStr = JsonConvert.SerializeObject(list);
LitJSON
下载LitJSON
添加DLL
①添加引用
using LitJson;②使用方法
JsonMapper.ToJson(list)
- 2013-12-01 14:45
- 浏览 822
- 评论(0)
方法一:
添加引用
using System.Globalization;
using System.Threading;
应用代码:
CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
TextInfo textInfo = cultureInfo.TextInfo;
Console.WriteLine(textInfo.ToTitleCase("abc"));
Console.Read();
方法二:
String className = "tb_adas ...
- 2013-11-29 12:29
- 浏览 790
- 评论(0)
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace cfzs.DAL
{
public class BaseDAL
{
#region DataTale转为实体列表
/// <summary>
/// DataTale转为实体列表
...
- 2013-11-29 08:45
- 浏览 782
- 评论(0)
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Net;
using System.IO;
namespace Util
{
/// <summary>
/// 有关HTTP请求的辅助类
/// </summary>
public class Ht ...
- 2013-11-26 16:20
- 浏览 901
- 评论(0)