资源简介
VS 环境下 WinForm 的 MVC 示例项目,它和 Web 下的 MVC 用法基本一样

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace CommonLibrary.Exceptions
{
public class LogException : Exception
{
private string GetStackTrack()
{
StackTrace st = new StackTrace(true);
string stackIndent = string.Empty;
for (int i = 0; i < st.frameCount; i++)
{
// Note that at this level there are four
// stack frames one for each method invocation.
Stackframe sf = st.Getframe(i);
stackIndent += String.Format(“ Method: {0}“ sf.GetMethod());
stackIndent += String.Format(“ File: {0}“ sf.GetFileName());
stackIndent += String.Format(“ Line Number: {0}“ sf.GetFileLineNumber());
stackIndent += “\r\n“;
}
return stackIndent;
}
public LogException(string error)
: base(error)
{
string fileDir = “C:\\SaleLog“;
if (System.IO.Directory.Exists(fileDir) == false)
{
System.IO.Directory.CreateDirectory(fileDir);
}
fileDir += “\\LogException“;
if (System.IO.Directory.Exists(fileDir) == false)
{
System.IO.Directory.CreateDirectory(fileDir);
}
DateTime now = DateTime.Now;
string filePath = String.Format(“{0}-{1}-{2}_{3}-{4}-{5}-{6}.txt“ now.Year now.Month now.Day now.Hour now.Minute now.Second now.Millisecond);
filePath = fileDir + “\\“ + filePath;
string text = error;
text += “\r\n“;
text += “----------------------------------------------------------------------------------“;
text += “\r\n“;
text += this.GetStackTrack();
System.IO.File.AppendAllText(filePath text);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 52736 2017-10-14 08:20 WinformMvcDemo\CommonLibrary\bin\Debug\CommonLibrary.dll
文件 1086 2015-04-08 09:37 WinformMvcDemo\CommonLibrary\bin\Debug\CommonLibrary.dll.config
文件 153088 2017-10-14 08:20 WinformMvcDemo\CommonLibrary\bin\Debug\CommonLibrary.pdb
文件 1748992 2014-04-10 13:31 WinformMvcDemo\CommonLibrary\bin\Debug\eBay.Service.dll
文件 73728 2014-04-10 13:31 WinformMvcDemo\CommonLibrary\bin\Debug\eBay.Service.SDK.Attribute.dll
文件 34816 2014-02-23 09:21 WinformMvcDemo\CommonLibrary\bin\Debug\EFCachingProvider.dll
文件 26624 2014-02-23 09:21 WinformMvcDemo\CommonLibrary\bin\Debug\EFProviderWrapperToolkit.dll
文件 15872 2014-02-23 09:21 WinformMvcDemo\CommonLibrary\bin\Debug\EFTracingProvider.dll
文件 29696 2017-09-27 11:24 WinformMvcDemo\CommonLibrary\bin\Debug\HelperUDP.dll
文件 101888 2017-09-27 11:24 WinformMvcDemo\CommonLibrary\bin\Debug\HelperUDP.pdb
文件 49152 2014-04-10 13:33 WinformMvcDemo\CommonLibrary\bin\Debug\Samples.Helper.dll
文件 47616 2017-10-15 10:31 WinformMvcDemo\CommonLibrary\bin\Release\CommonLibrary.dll
文件 1086 2015-04-08 09:37 WinformMvcDemo\CommonLibrary\bin\Release\CommonLibrary.dll.config
文件 1445376 2017-10-15 10:31 WinformMvcDemo\CommonLibrary\bin\Release\CommonLibrary.pdb
文件 1748992 2014-04-10 13:31 WinformMvcDemo\CommonLibrary\bin\Release\eBay.Service.dll
文件 73728 2014-04-10 13:31 WinformMvcDemo\CommonLibrary\bin\Release\eBay.Service.SDK.Attribute.dll
文件 34816 2014-02-23 09:21 WinformMvcDemo\CommonLibrary\bin\Release\EFCachingProvider.dll
文件 26624 2014-02-23 09:21 WinformMvcDemo\CommonLibrary\bin\Release\EFProviderWrapperToolkit.dll
文件 15872 2014-02-23 09:21 WinformMvcDemo\CommonLibrary\bin\Release\EFTracingProvider.dll
文件 1315840 2017-10-11 21:44 WinformMvcDemo\CommonLibrary\bin\Release\Geckofx-Core.dll
文件 1598976 2017-10-11 21:44 WinformMvcDemo\CommonLibrary\bin\Release\Geckofx-Core.pdb
文件 136704 2017-10-11 21:44 WinformMvcDemo\CommonLibrary\bin\Release\Geckofx-Winforms.dll
文件 284160 2017-10-11 21:44 WinformMvcDemo\CommonLibrary\bin\Release\Geckofx-Winforms.pdb
文件 27136 2017-09-27 10:27 WinformMvcDemo\CommonLibrary\bin\Release\HelperUDP.dll
文件 103936 2017-09-27 10:27 WinformMvcDemo\CommonLibrary\bin\Release\HelperUDP.pdb
文件 49152 2014-04-10 13:33 WinformMvcDemo\CommonLibrary\bin\Release\Samples.Helper.dll
文件 6539 2017-10-13 16:30 WinformMvcDemo\CommonLibrary\CommonLibrary.csproj
文件 2049 2014-04-28 17:32 WinformMvcDemo\CommonLibrary\Exceptions\LogException.cs
文件 781 2015-08-31 14:14 WinformMvcDemo\CommonLibrary\Exceptions\MessageException.cs
文件 194 2014-05-15 08:36 WinformMvcDemo\CommonLibrary\Exceptions\NonException.cs
............此处省略311个文件信息
相关资源
- Winform可视化打印模板设计工具含源码
- 语音播报系统叫号系统的
- c#获取mobile手机的IMEI和IMSI
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- MVC model层代码生成器 C#
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- 基于c#的实验室设备管理系统621530
- C# 五子棋程序 附带编程日记
- C#网络三子棋
- C# winform实现表数据导出到Excel表格
- 用C#做的鲜花管理系统
- C#编写的后方交会程序
- C#winfrom漂亮的登陆界面
- C#写的键盘和鼠标记录程序(记录你点
- 用WPF开发的多人聊天室 语言C#
- asp.net中c#做的躲避小游戏,希望大家
- C#获取显示器的分辨率
- C#开发的OCR识别程序源码
- C# Office 2007 Ribbon 风格的按钮和菜单
- 一个很强大的C#第三方控件!!(附带
- C#实现的遗传算法类库
- 网络搜图精灵(C#写的)
- 一款漂亮的灯光闪烁的圣诞树(C# V
- C# WinForm读写INI文件
- 随机抽题系统C#源代码
评论
共有 条评论