Keung

导航

随笔分类 -  C#

c#连接sql数据库查询修改类
摘要:本人新手,没什么开发经验,下面代码是网上资料整理所得,经测试验证没问题,仅供参考using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;using System.Configuration;namespace DbTest{ public class DbHelper { private readonly string SQLCONNECTSTR = "server=17... 阅读全文

posted @ 2012-07-03 11:00 CrazyKeung 阅读(1218) 评论(0) 推荐(0)

[转] C#获取当前进程(程序)的完整路径备忘
摘要://获取当前进程的完整路径,包含文件名(进程名)。string str = this.GetType().Assembly.Location;result: X:/xxx/xxx/xxx.exe (.exe文件所在的目录+.exe文件名)//获取新的 Process 组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。string str = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;result: X:/xxx/xxx/xxx.exe (.exe文件所在的目录+.exe文件名)// 阅读全文

posted @ 2012-04-24 19:43 CrazyKeung 阅读(607) 评论(0) 推荐(0)