随笔分类 - 工具集
基础处类库,用于程序的基础操作,减少开发的困难和时间,提高开发效率
摘要:1 取值后格式化{0:d}小型:如2005-5-6{0:D}大型:如2005年5月6日{0:f}完整型2 当前时间获取 DateTime.Now.ToShortDateString3 取值中格式化SQL Server里面可能经常会用到的日期格式转换方法:sql server使用convert来取得d...
阅读全文
摘要:USE [toy]GO/****** Object: StoredProcedure [dbo].[L2U] Script Date: 03/19/2014 13:15:27 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[L2U] (@n_LowerMoney numeric(15,2),@v_TransType int,@RET VARCHAR(200) output)AS Declare @v_LowerStr VARCHAR(200) -- 小写金额 Declare @v_Up...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Data.SqlClient;using System.Data;using System.Windows.Forms;using System.Drawing;namespace DAL{ public static class DbOperation { private static string connStr = "Data Source=127.0.0.1;Initial Catalog=Toy;Pers...
阅读全文
摘要:ALTER FUNCTION getPinYin(@HZ NVARCHAR(4000))RETURNS NVARCHAR(4000)ASBEGINDECLARE @word NCHAR(1)DECLARE @PY NVARCHAR(4000)SET @PY = ''WHILE LEN(@HZ) > 0 BEGIN SET @word = LEFT(@HZ,1) SET @PY = @PY + (CASE WHEN UNICODE(@word) BETWEEN 19968 AND 19968+20901 THEN (SELECT TOP ...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Net;using System.Management;namespace Utility{ public static class LocalMachine { //获取IP地址: /// /// 获取客户端内网IP地址 /// /// public static string getClientLocalIPAddress() ...
阅读全文
摘要:public static class DbOperation { private static string connStr = "Data Source=127.0.0.1;Initial Catalog=wk;Persist Security Info=True;User ID=sa;Password=123"; public static string DbQueryCount(string cmdStr) { string result = ""; SqlConnection conn = n...
阅读全文
摘要:public class FtpOperation { public static void UploadFile(FileInfo fileinfo, string targetDir, string hostname, string username, string password, string reName) { //1. check target string target; if (targetDir.Trim() == "") { ...
阅读全文
摘要:public static string GetMD5HashFromFile(string fileName) { try { FileStream file = new FileStream(fileName, FileMode.Open); System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); b...
阅读全文
摘要:private string GetMD5str(string oldStr) { //将输入转换为ASCII 字符编码 ASCIIEncoding enc = new ASCIIEncoding(); //将字符串转换为字节数组 byte[] buffer = enc.GetBytes(oldStr); //创建MD5实例 MD5 md5 = new MD5CryptoServiceProvider(); //进行MD5加密 ...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Security.Cryptography;using System.IO;using System.Data;using System.Data.SQLite;using System.Web;using System.Runtime.InteropServices;namespace AiXinTang.User{ public static class DbSafe { pu...
阅读全文

浙公网安备 33010602011771号