摘要: /// /// 进行DES加密。 /// /// 要加密的字符串。 /// 密钥,且必须为8位。 /// 以Base64格式返回的加密字符串。 public static string DESEncrypt(string pToEncrypt,string strkey) { try { using (DESCryptoServiceProvider des = new DESCryptoServiceProvider(... 阅读全文
posted @ 2014-02-10 11:24 刘文天 阅读(3716) 评论(0) 推荐(1) 编辑
摘要: C# 编写Windows服务、部署、启动以及卸载1、创建 ,2、在构造函数中启动 System.Timers.Timer3、编写代码后,创建其安装程序;ServiceName即4、安装:C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe 服务exe路径5、启动:net start 6、卸载:C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u 服务exe路径 阅读全文
posted @ 2013-10-23 17:37 刘文天 阅读(368) 评论(0) 推荐(0) 编辑
摘要: //json时间转为 标准时间格式function JSONDateToJSDate(JSONDateString) { if (JSONDateString != undefined) { var date = new Date(parseInt(JSONDateString.replace("/Date(", "").replace(")/", ""), 10)); var hh = date.getHours(); var mm = date.getMinutes(); var ss = date.getSe 阅读全文
posted @ 2013-10-22 14:49 刘文天 阅读(547) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace LotteryTicket.Entity{ [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Field, AllowMultiple = true, Inherited = false)] public class XmlNodeN... 阅读全文
posted @ 2013-09-17 17:17 刘文天 阅读(315) 评论(0) 推荐(0) 编辑
摘要: create proc up_get_user_age_by_user_id@id int,@age int outputasbegin select @age= Age from En_User where Id=@idenddeclare @res intexec up_get_user_age_by_user_id 19,@res outputprint @res带传入参数,输出参数的存储过程写法。常用命令:sp_helptext:查看存储过程的定义信息。sp_rename:重命名存储过程。ep:sp_rename ,alter procedure:修改存储过程。drop proc... 阅读全文
posted @ 2013-08-18 21:49 刘文天 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Insert语句:Insert Into Shop_Customer(FirstName,LastName) Values('','');Update语句:Update Shop_Customer Set FirstName='',LastName='' Where Id=@idDelete语句:Select * From Shop_Customer Where Id=@idSelect语句:Delete From Shop_Customer Where Id=@id2、写出一条Sql语句:取出表A中第31到第40记录(SQLSe 阅读全文
posted @ 2013-07-30 09:31 刘文天 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 多线程Main代码: new Thread(new TextUploadServer()).start(); new Thread(new TextUploadClient()).start(); 客户端代码: 1 public class TextUploadClient implements Runnable { 2 @Override 3 public void run() { 4 try { 5 Socket socket = new Socket(InetAddress.getLocalHost(), 5000... 阅读全文
posted @ 2013-07-26 21:19 刘文天 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Type t = typeof(TestAttribute); object[] attributes = t.GetCustomAttributes(false); foreach (var attr in attributes) { if (attr.GetType() == typeof(LogInfoAttribute)) { LogInfoAttribute att = (LogInfoAttribute)attr; ... 阅读全文
posted @ 2013-07-25 09:58 刘文天 阅读(152) 评论(0) 推荐(0) 编辑
摘要: package com.wentian.service;import java.io.File;import java.io.FileInputStream;import java.io.FileWriter;import java.util.ArrayList;import java.util.List;import org.xmlpull.v1.XmlPullParser;import org.xmlpull.v1.XmlSerializer;import android.util.Xml;import com.wentian.bean.Person;public class XmlSer 阅读全文
posted @ 2013-06-21 16:15 刘文天 阅读(241) 评论(0) 推荐(0) 编辑
摘要: class Link{ public int iData; public double dData; public Link next; public Link(int i,double d) { this.iData=i; this.dData=d; } public void display() { System.out.print("{"+this.iData+","+this.dData+"}"); }}class LinkList{ public Link first; public LinkList() { this.fi 阅读全文
posted @ 2013-06-07 09:16 刘文天 阅读(264) 评论(0) 推荐(0) 编辑