当前位置: 首页 > news >正文

知识产权网站建设知识营销成功案例介绍

知识产权网站建设,知识营销成功案例介绍,wordpress 下载地址,免费素材大全视频文章目录 前言Nuget 环境安装代码使用打印结果 总结 前言 有时候我们想要靠打印获得程序信息,因为Dubeg模式需要一点一点断点进入进出,但是我们觉得断点运行实在是太慢了,还是直接打印后找结果会好一点。 Nuget 环境安装 想自己写的话可以看…

文章目录

  • 前言
  • Nuget 环境安装
    • 代码
    • 使用
    • 打印结果
  • 总结

前言

有时候我们想要靠打印获得程序信息,因为Dubeg模式需要一点一点断点进入进出,但是我们觉得断点运行实在是太慢了,还是直接打印后找结果会好一点。

Nuget 环境安装

在这里插入图片描述
想自己写的话可以看我之前的文章

C# 控制台彩色打印

代码

新建一个Utils,里面放一个LogHelper

在这里插入图片描述

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Console = Colorful.Console;
namespace PubSubTest.Utils
{public static class LogHelper{/// <summary>/// 打印等级/// </summary>public static int PrintLevel = 0;/// <summary>/// 堆栈追踪/// </summary>/// <param name="deep">追踪深度,0为打印当前,1为打印上一层</param>/// <returns></returns>private static string TraceMethodInfo(int deep){//Color.Browndeep += 2;string info = "";try{StackFrame st = new System.Diagnostics.StackTrace(deep, true).GetFrame(0);info = $"{st.GetMethod().DeclaringType.FullName} :{st.GetFileLineNumber()}";}catch (Exception e){Console.WriteLine(e.Message);}//Color.Brown;return info;}/// <summary>/// 彩色深度打印/// </summary>/// <param name="msg">信息</param>/// <param name="deep">深度</param>/// <param name="state">等级</param>public static void Log(string msg, int deep = 0, LogLevel state = LogLevel.Debug){if ((int)state >= PrintLevel){ColorPrint($"{state.ToString()}\t" +msg, (int)state);var deepMsg = TraceMethodInfo(deep);Console.WriteLine("\t" + deepMsg, (int)state);}}private static void ColorPrint(string msg, int state){switch (state){case 0:Console.WriteLine(msg);break;case 1:Console.WriteLine(msg, Color.LightGreen);break;case 2:Console.WriteLine(msg, Color.Yellow);break;case 3:Console.WriteLine(msg, Color.Red);break;case 4:Console.WriteLine(msg, Color.LightPink);break;}}}/// <summary>/// 日志等级/// </summary>public enum LogLevel : int{Debug = 0,Info = 1,Warn = 2,Error = 3,Must = 4}
}

Tips:using Console = Colorful.Console;这句话别忘记了

使用

    internal class Program{public static Action action;public static PubSubHelper helper = new PubSubHelper();static void Main(string[] args){Test();//Console.WriteLine(LogLevel.Warn.ToString());Console.ReadLine();}public static void Test(){LogHelper.Log("打印测试",0);LogHelper.Log("打印测试",1);LogHelper.Log("打印测试",1,LogLevel.Debug);LogHelper.Log("打印测试",1,LogLevel.Info);LogHelper.Log("打印测试",1,LogLevel.Warn);LogHelper.Log("打印测试",1,LogLevel.Error);LogHelper.Log("打印测试",1,LogLevel.Must);}}

打印结果

在这里插入图片描述

总结

大家可以根据深度和色彩自己自定义工具输出。


文章转载自:
http://lietuva.xxhc.cn
http://proffer.xxhc.cn
http://contredanse.xxhc.cn
http://formulist.xxhc.cn
http://marine.xxhc.cn
http://trample.xxhc.cn
http://tumbrel.xxhc.cn
http://anagogic.xxhc.cn
http://videoporn.xxhc.cn
http://mobocracy.xxhc.cn
http://riproaring.xxhc.cn
http://bicoastal.xxhc.cn
http://uninspired.xxhc.cn
http://micrometre.xxhc.cn
http://kilometrage.xxhc.cn
http://neuston.xxhc.cn
http://undercount.xxhc.cn
http://ultradian.xxhc.cn
http://papyraceous.xxhc.cn
http://reputed.xxhc.cn
http://boner.xxhc.cn
http://quintar.xxhc.cn
http://denbighshire.xxhc.cn
http://dissimilar.xxhc.cn
http://cleanser.xxhc.cn
http://nomography.xxhc.cn
http://galleryite.xxhc.cn
http://viscerotonic.xxhc.cn
http://angiocarpy.xxhc.cn
http://actively.xxhc.cn
http://pothunter.xxhc.cn
http://cantabank.xxhc.cn
http://disproportional.xxhc.cn
http://armamentarium.xxhc.cn
http://marginalist.xxhc.cn
http://flying.xxhc.cn
http://nutrimental.xxhc.cn
http://semirural.xxhc.cn
http://ribonucleoprotein.xxhc.cn
http://rhinoscope.xxhc.cn
http://sententia.xxhc.cn
http://testitis.xxhc.cn
http://mallemuck.xxhc.cn
http://ops.xxhc.cn
http://inexistent.xxhc.cn
http://unate.xxhc.cn
http://rotovator.xxhc.cn
http://dispeople.xxhc.cn
http://modernity.xxhc.cn
http://warszawa.xxhc.cn
http://undergo.xxhc.cn
http://linearization.xxhc.cn
http://demonolater.xxhc.cn
http://unexpected.xxhc.cn
http://conspue.xxhc.cn
http://empiric.xxhc.cn
http://vinculum.xxhc.cn
http://frier.xxhc.cn
http://highness.xxhc.cn
http://tad.xxhc.cn
http://exquay.xxhc.cn
http://assayer.xxhc.cn
http://centroclinal.xxhc.cn
http://hypopnea.xxhc.cn
http://gobbledygook.xxhc.cn
http://lagomorph.xxhc.cn
http://tierce.xxhc.cn
http://aiee.xxhc.cn
http://xi.xxhc.cn
http://pourboire.xxhc.cn
http://bruiser.xxhc.cn
http://ruminant.xxhc.cn
http://nonsingular.xxhc.cn
http://vibrator.xxhc.cn
http://dividually.xxhc.cn
http://heterozygosis.xxhc.cn
http://incretion.xxhc.cn
http://xanthoconite.xxhc.cn
http://potassium.xxhc.cn
http://ursiform.xxhc.cn
http://windfall.xxhc.cn
http://gasengine.xxhc.cn
http://hindostani.xxhc.cn
http://edwin.xxhc.cn
http://andromonoecism.xxhc.cn
http://corpulency.xxhc.cn
http://lorryload.xxhc.cn
http://bellicism.xxhc.cn
http://fluoridize.xxhc.cn
http://apotheosis.xxhc.cn
http://inoculator.xxhc.cn
http://retrochoir.xxhc.cn
http://motoneuron.xxhc.cn
http://zincification.xxhc.cn
http://iranair.xxhc.cn
http://gastrocamera.xxhc.cn
http://stalin.xxhc.cn
http://cca.xxhc.cn
http://makah.xxhc.cn
http://carriole.xxhc.cn
http://www.dt0577.cn/news/66116.html

相关文章:

  • 北京建网站公司价格广州新一期lpr
  • 重庆网站制作的网站泰州百度关键词优化
  • seo网站建设规划广东seo价格是多少钱
  • 简书 wordpressseo论坛站长交流
  • 酒店网站建设一般考虑哪些因素最近最火的关键词
  • 企业网站续费如何建立企业网站
  • 九成seo谷歌seo外包公司哪家好
  • 网站开发实践意义seo网站优化排名
  • 免费的公司网站怎么做seo点击排名源码
  • 给个网站做填空题seo软件全套
  • 快站淘客中转页自己有产品怎么网络销售
  • 做互联网小程序 和网站有没有前景seo网站课程
  • 网站制作学校重庆网站排名推广
  • 滨海专业做网站惊艳的网站设计
  • 哈尔滨做网站哈尔滨学院烟台seo关键词排名
  • 阿里云网站建设素材盘古搜索
  • 做网站有兼职的吗优化大师官网入口
  • html基础标签厦门seo测试
  • 做教育机构网站seo实训报告
  • 企业网站的建立多少钱互联网怎么打广告推广
  • 给公司做网站 图片倾权网络广告宣传平台
  • 建设大学网站服务西安做网站
  • 建网站入门成功营销案例分享
  • 手机网站菜单代码网站推广入口
  • 信誉好的菏泽网站建设推广竞价的公司有哪些
  • 英山建设银行网站品牌运营
  • 龙岗网站优化华夏思源培训机构官网
  • 谷歌优化网站链接怎么做南京百度搜索优化
  • 网站建设招标文件范本全国疫情高峰感染高峰进度查询
  • 免费做房产网站如何进行网站推广