摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; namespace calculate { struct StdHandleEn... 阅读全文
随笔档案-2016年04月
C#Process执行批处理后如何获取返回值?
2016-04-22 15:09 by Dorisoy, 8182 阅读, 收藏,
摘要:
代码如下 p.StartInfo = new System.Diagnostics.ProcessStartInfo(path, pwd); p.Start();其中path是个BAT的路径!我想要得到执行后的返回值来判断批处理运行期间是否错误?请问如何做呢?批处理程序内容如下:@echo offf 阅读全文
AutoFac使用方法总结:Part III
2016-04-21 09:58 by Dorisoy, 234 阅读, 收藏,
摘要:
生命周期 AutoFac中的生命周期概念非常重要,AutoFac也提供了强大的生命周期管理的能力。 AutoFac定义了三种生命周期: Per Dependency为默认的生命周期,也被称为’transient’或’factory’,其实就是每次请求都创建一个新的对象 [Fact] public v 阅读全文
AutoFac使用方法总结:Part II
2016-04-21 09:56 by Dorisoy, 270 阅读, 收藏,
摘要:
事件 AutoFac支持三种事件:OnActivating,OnActivated,OnRelease。OnActivating在注册组件使用之前会被调用,此时可以替换实现类或者进行一些其他的初始化工作,OnActivated在实例化之后会被调用,OnRelease在组件释放之后会被调用。 publ 阅读全文
AutoFac使用方法总结:Part I
2016-04-21 09:54 by Dorisoy, 288 阅读, 收藏,
摘要:
注册部分 使用RegisterType进行注册 [Fact] public void can_resolve_myclass() { var builder = new ContainerBuilder(); builder.RegisterType<MyClass>(); IContainer c 阅读全文
Adding the Test API in The ASP.NET Web API Help Page
2016-04-06 10:43 by Dorisoy, 157 阅读, 收藏,
摘要:
http://www.c-sharpcorner.com/UploadFile/2b481f/adding-the-test-api-in-the-Asp-Net-web-api-help-page/ 阅读全文
Attribute Routing in ASP.NET MVC 5
2016-04-05 11:31 by Dorisoy, 175 阅读, 收藏,
摘要:
Attribute Routing in ASP.NET MVC 5 阅读全文
Attribute Routing in ASP.NET Web API 2
2016-04-05 11:30 by Dorisoy, 188 阅读, 收藏,
摘要:
Attribute Routing in ASP.NET Web API 2 阅读全文
FileStream:The process cannot access the file because it is being used by another process
2016-04-05 09:38 by Dorisoy, 1037 阅读, 收藏,
摘要:
先看下面一段代码(先以共享的方式打开文件读写,然后以只读的方式打开相同文件): FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); FileStream 阅读全文
C# The process cannot access the file because it is being used by another process
2016-04-05 09:32 by Dorisoy, 3155 阅读, 收藏,
摘要:
C# The process cannot access the file because it is being used by another process The process cannot access the file because it is being used by anoth 阅读全文
ImportError with IronPython in C#
2016-04-03 11:59 by Dorisoy, 474 阅读, 收藏,
摘要:
I was using IronPython to execute python code inside my C# implementation lately, and I encountered this error when trying to use xmlrpclib: It was re 阅读全文
Unity 捕获IronPython脚本错误
2016-04-03 11:57 by Dorisoy, 689 阅读, 收藏,
摘要:
using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using System.Windows.Forms; using IronPython.Hosting; using IronPython.Runtime; using Iro... 阅读全文
在C#环境中动态调用IronPython脚本(二)
2016-04-03 11:56 by Dorisoy, 987 阅读, 收藏,
摘要:
一、Python数据类型与C#数据类型的对应 Python中数据类型中的简单类型,例如int,float,string可以对应到C#环境中的int32,double,string,这些对应比较直观,Python中的复杂数据类型,例如List,Set等是C#环境中没有的,好在IronPython提供了 阅读全文
在C#环境中动态调用IronPython脚本(一)
2016-04-03 11:54 by Dorisoy, 914 阅读, 收藏,
摘要:
本文讲述用C#调用Ironpython运行环境,解析并运行动态pyhton脚本。这种情况应用在那些需要滞后规定行为的场合,例如,动态计算项(计算引擎),用户可以自定义计算内容、计算公式等。 本文的代码适用于IronPython 2.7(需要下载及安装)及C#4.0,由于IronPython早期版本提 阅读全文
浙公网安备 33010602011771号