• C#工具类(一):使用ADO.Net封装OracleHelper

    作者: 陆金龙       发表时间: 2015-05-12 00:11
    Oracle版本的SqlHelper,只提供基本的用法参考。 更多更详细请参考:C#工具类(一):使用ADO.Net封装SqlHelper   using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data.OracleClient; using System.Configuration; using System.Data; namespace Kinglong.App.Tools { ...
  • C#工具类(一):使用.Net封装SqliteHelper

    作者: 陆金龙       发表时间: 2015-05-12 01:31
    使用.Net封装Sqlite数据库操作工具类 需要应用第三方库System.Data.SQLite.dll using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Data.SQLite; using System.Data; namespace Kinglong.App.Tools { public static class SqliteHelper { #region ...
  • C#工具类(一):使用.Net封装MongodbHelper

    作者: 陆金龙       发表时间: 2015-05-12 01:54
    C#对Mongodb操作工具类的封装。 需要引用MongoDB.Driver.dll和MongoDB.Bson.dll两个库。 using System; using System.Collections.Generic; using System.Linq; using System.Text; using MongoDB.Driver; using MongoDB.Bson; using MongoDB.Driver.Builders; using MongoDB.Driver.Linq; namespace Kinglong.AppServer.To...
  • C#工具类(二):对各数据类型Null值的封装

    作者: 陆金龙       发表时间: 2015-05-12 01:01
    将各数据类型在未赋值情况下使用的默认值,统一封装到一个Null类中。 /// /// NULL /// public class Null { public static short NullShort { get { return -1; } } public static int NullInteger { ...
  • C#工具类(三):C#通过Http请求获取字符串结果和下载文件

    作者: 陆金龙       发表时间: 2015-05-12 01:41
    C#实现通过HttpPost请求,返回响应结果的字符串格式; C#实现通过HttpGet请求,返回响应结果的字符串格式。 C#实现通过HttpGet请求,完成文件下载。 using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; namespace Kinglong.App.Tools { public class HttpRequestHelper { /// ...
  • C#发送Http请求的类库封装及应用

    作者: 陆金龙       发表时间: 2014-12-20 19:11
    一、C#发送Http请求的类库封装 很多时候,使用C#发送Http请求,可以给编程带来很多便利。通过以下封装的方法,可以很方便的向Aspnet中的一般处理程序、WebService、WebAPI、WCF等服务发送Http请求。可以根据需要发送Get请求或post请求,使用返回的字符串结果实现相关的功能。当然,也适用.Net工程中对PHP和Jsp服务的请求。 以下是封装好的Http请求的工具类。 public class HttpRequestHelper     { &nbs...
  • AppDomain.CurrentDomain.AssemblyResolve事件 控制运行时重新指定程序集路径加载dll文件

    作者: 陆金龙       发表时间: 2015-08-08 10:06
    有时候,需要将被引用的程序集放到单独的目录统一维护(如更新等),提供给多个项目使用到这些程序集。 我们知道,项目在添加了对程序集的引用后,编译时通常会将引用的程序集一起生成到bin或release目录。现在为了统一管理,我们把这些要引用的程序集放到一个公共的目录,供多个项目使用,同时我们移除掉bin或release目录下的这些dll文件。默认情况下,程序运行过程中需要加载一个程序集,会先后从系统目录和程序运行目录查找要加载的dll文件,如果都没有查找到,将会抛出一个异常:System.IO.FileNotFoundException: 未能加载文件或程序集“Accessib...
  • C#为应用程序创建快捷方式

    作者: 陆金龙       发表时间: 2015-05-24 11:53
    通常安装玩客户端,需要为应用程序创建桌面快捷方式。C#创建的快捷方式的代码如下: private void Createshort(string name, string description, string targetPath) { if (!name.EndsWith(".lnk")) { name += ".lnk"; } WshShell shell = new WshShell(); IWshShortcut shortcut = (IWshShortcut)sh...