- 註冊 GlobMgr.dll D:\Program Files\Agilent\VEE Pro 7.0>regsvr32.exe "c:\VXIPNP\VisaCom\GlobMgr.dll"
- 在visual stdio 2005的參考COM標籤頁中,參考 "VISA COM 3.0 Type Library"
- 參考 C:\VXIPNP\VisaCom\BasFrmIO.dll
如果出現錯誤訊息COMException was caught 80040154,解決辦法為
使用Regsvr32 工具(Regsvr32.exe)去註冊與註銷OLE控制項,好比DLL或ActiveX控制項是可以自我註銷的。要解決這個問題需要對Windows,Microsoft Internet Explorer, 或者其它程式進行錯誤排除的動作。
2010年12月31日 星期五
使用VISACom函式庫
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2010年3月15日 星期一
Log函式庫 - NLog
下載 NLog-VERSION-setup.exe並安裝。
開啟一個專案並選擇"Add New Item..."選項去加入NLog設定檔。
加入一個空白的NLog設定檔。在NLog設定檔的屬性中,將屬性""Copy to Output Directory"的值改為"Copy always"。
在專案中加入一個名為"Program.cs"的檔案,內容如下:
NLog.config
參考Log等級
參考網址
開啟一個專案並選擇"Add New Item..."選項去加入NLog設定檔。
加入一個空白的NLog設定檔。在NLog設定檔的屬性中,將屬性""Copy to Output Directory"的值改為"Copy always"。
在專案中加入一個名為"Program.cs"的檔案,內容如下:
using System;
using System.Collections.Generic;
using System.Text;
using NLog;
namespace NLogExample
{
class Program
{
private static Logger logger = LogManager.GetCurrentClassLogger();
static void Main(string[] args)
{
logger.Debug("Hello World!");
}
}
}
NLog.config
<br /><nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" <br /> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <br /> <targets> <br /> <target name="console" xsi:type="ColoredConsole" <br /> layout="${date:format=HH\:mm\:ss}|${level}|${stacktrace}|${message}"/> <br /> <target name="file" xsi:type="File" fileName="${basedir}/file.txt" <br /> layout="${stacktrace} ${message}"/> <br /> </targets> <br /> <rules> <br /> <logger name="*" minlevel="Trace" writeTo="console,file"/> <br /> </rules> <br /></nlog> <br />參考Log等級
Trace - Very detailed log messages, potentially of a high frequency and volume Debug -Less detailed and/or less frequent debugging messages Info - Informational messages Warn - Warnings which don't appear to the user of the application Error - Error messages Fatal - Fatal error messages. After a fatal error the application usually terminates. Reference Open source logging tools in C# NLog-Advanced .NET Logging
參考網址
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
訂閱:
文章 (Atom)