ICode9

精准搜索请尝试: 精确搜索
  • 记一次dotnet拆分包,并希望得大佬指点2022-04-03 15:34:27

    记一次dotnet拆分包,并希望得大佬指点 之前做了一个用于excel导入导出的包, 定义了一些接口, 然后基于 NPOI EPPlus MiniExcel 做了三种实现 接口大概长下面这样(现在可以在接口里面写静态函数了!) public interface IExcelReader { // 根据一些条件返回下面的实现 public

  • 利用浏览器打开HTML文件2021-09-29 11:03:11

    using System;namespace Belender{    class Program    {        public static void Main(string[] args)        {            try            {                System.Diagnostics.Process.Start("firefox", AppDomain.Curr

  • Winform增加全局异常捕获2021-06-04 13:35:03

    在Program类中 /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { try { //设置应用程序处理异常方式:ThreadException处理 Application.SetUn

  • C#如何在反射中处理项目间的依赖关系(无法找到程序集异常)2021-05-21 21:31:04

    介绍 当两个dll文件之间具有依赖关系时(例如A引用B),在第三方项目中通过反射去动态加载依赖另一项的dll(也就是调用A),即使这两个文件在同一目录下,也有可能会抛出could not load file or assembly的异常(如果不抛自然是最好了),下面就来介绍一下如何在第三方程序集中动态的加依赖。 开

  • C#中AppDomain.CurrentDomain.BaseDirectory及各种路径获取方法2021-03-30 21:01:09

    C#中AppDomain.CurrentDomain.BaseDirectory及各种路径获取方法 https://www.360kb.com/kb/2_87.html // 获取程序的基目录。 System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径,包含文件名 System.Diagnostics.Process.GetCurrentProcess().MainModule.FileNam

  • WinForm 捕获异常 Application.ThreadException + AppDomain.CurrentDomain.UnhandledException2021-03-15 11:02:10

    WinForm 捕获未处理的异常,可以使用Application.ThreadException 和AppDomain.CurrentDomain.UnhandledException事件  WinForm程序的全局错误处理可以在Program文件中设置处理事件,如下: static class Program { /// <summary> /// 应用程序的主入

  • C#中AppDomain.CurrentDomain.BaseDirectory(获取程序的基目录)及各种路径获取方法2021-01-11 20:02:06

    https://blog.csdn.net/bingle14/article/details/52922366 // 获取程序的基目录。 System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径,包含文件名 System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName // 获取和设置当前目录(该进程从中启动

  • C#反射中使用到Emit时,发现AppDomain.CurrentDomain.DefineDynamicAssembly()方法并不存在2021-01-04 17:01:37

    C#反射中使用到Emit时,发现AppDomain.CurrentDomain.DefineDynamicAssembly()方法并不存在,但是官网.Net 5给出得例子中仍然使用了此方法https://docs.microsoft.com/zh-cn/dotnet/api/system.reflection.emit.assemblybuilder?view=net-5.0 此问题解决方案是将AppDomain.CurrentDo

  • 基于CefSharp开发(一)开发什么?没想好2020-11-02 17:03:32

    一、创建项目 创建WPF (.Net Core)项目  二、CefSharp引用 程序包管理器控制台引入CefSharp Install-Package CefSharp.Wpf -Version 85.3.130   CefSharp默认不支持AnyCPU,因此需要添加AnyCPU支持 https://github.com/cefsharp/CefSharp/issues/1714 首先在Project中增加如

  • 命令行下启动c#控制台程序exe,提示找不到系统文件2020-06-23 11:54:14

    场景:在exeA启动exeB时候,如果在工具目录下用xxx.exe启动,是正常的;但是在别的目录,用绝对路径启动这个工具,会提示找不到exeB。 问题:永远相信报错,就是"路径问题"导致系统找不到 解决方案: 如果是直接用文件名称(相对路径)启动的,需要完善路径信息;获取路径信息需要使用 > System.AppDomain.C

  • 转:C#:在AnyCPU模式下使用CefSharp2020-01-21 17:07:50

    ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥-------------       本篇博客讲述如何在AnyCPU模式下使用CefSharp 因为在某些情况下,不得不用AnyCPU,但是CefSharp支持的是86和64位俩种模式,所以在我查阅了很多国内外的资料下,总结出来的一些精华   参考地址: https://ourcodeworl

  • WPF UnhandledException阻止程序奔溃2019-12-31 14:52:53

    WPF程序捕获全局异常,遇到未处理的异常,虽可以捕获,但是不能阻止程序退出。 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); void CurrentDomain_UnhandledException(object sender, UnhandledExcept

  • Path.Combine(2019-08-01 18:00:15

    // 获取程序的基目录。 var dir1 = System.AppDomain.CurrentDomain.BaseDirectory; // 获取模块的完整路径。 var dir2 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; // 获取和设置当前

  • C# 获取程序运行目录2019-07-11 11:55:30

    // 获取程序的基目录。 System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径。 System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName // 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。 System.Environment.CurrentDirectory // 获

  • C#+ItextSharp 查看pdf文件页面尺寸2019-06-04 23:01:15

    1# Nuget下载itextSharp,下载到本地 pm>Install-Package iTextSharp -Version 5.5.10 2# 引用dll,添加命名空间 using iTextSharp.text.pdf; 1 PdfReader pr = new PdfReader(fn);2 for (int j = 1; j <= pr.NumberOfPages; j++)3

  • swagger2019-02-26 09:02:23

    swagger:1.Nuget安装Swashbuckle依赖2.修改SwaggerConfig.csGlobalConfiguration.Configuration.EnableSwagger(c => { c.SingleApiVersion("v1", "ZJCD.User.Service"); c.IncludeXmlComments(string.Format("{0}/bin/ZJCD.User.Service.xml&qu

  • C# 加载配置文件2019-02-22 18:38:08

    //加载配置文件 var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables();

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有