原创 關於地址與IP的映射
關於IIS中部署一個網站後的映射地址: 1.進入這個目錄下,C:\Windows\System32\drivers\etc,在此用記事本打開hosts文件; 2.在最後一行加上你想映射的名字與IP地址: 10.32.152.133 r
原创 檢查xml格式是否正確
1.檢查xml格式 public static bool IsCorrectXmlFormat(string configuration) { bool isCorrectXmlFormat = t
原创 VS2010用C#寫單元測試的一些總結
1.單元測試中一個完整的測試類: [TestClass] public class SomeClassTest { [TestInitialize()] [HostTy
原创 VS2010 創建WindowsService服務
1.新建一個Windows 服務 2.添加Installer 這一步很重要,在處理完你的業務邏輯後需要添加一個Installer才能是你的Windows服務被安裝。 在VS中添加Installer 右鍵你的Service服務,選擇Vie
原创 爲GUID添加默認值
SQL 語句如下: ALTER TABLE [dbo].[TableName] ADD CONSTRAINT [DF_TableName_GUID] DEFAULT (newsequentialid()) FOR [GUID
原创 The current identity (NT AUTHORITY/NETWORK SERVICE)
The current identity (NT AUTHORITY/NETWORK SERVICE) does not have write access to 'C:/WINDOWS/Microsoft.NET/Framework/v
原创 Cache應用
1.首先從數據庫中取數據,代碼如下: private const string CacheAllProduct = "MyProduct"; private const string ConnectionString =
原创 How to create WSDL SourceCode from a webservice.
How to create WSDL SourceCode from a webservice. Browse (with IE) your web service home page (the asmx
原创 MEF的一點理解
0.我例子的工程結構 1.首先在程序啓動時拿到要動態加載dll所在的目錄。WepApplication中的Global.asax文件中: public static DirectoryCatalog C
原创 DevExpress 控件RepositoryItemComboBox
RepositoryItemComboBox控件作爲FilterControl 的編輯控件時,有時我們想讓它的編輯控件不可編輯而只是作爲Dropdownlist去選擇 於是我們設置RepositoryItemComboBox的TextEd
原创 調用MSBuild打Website的部署zip包
1.調用Msbuild爲Website打zip部署包: 2.當讓我們的程序需要引用: assemblyref://Microsoft.Build assemblyref://Microsoft.Build.Conversion.v4.0
原创 Powershell腳本部署打好的Website zip包並重啓IIS
直接上Power腳本: #Get current path $CurrentDir = $( pwd ); #Get MSDeploy path Write-Host "Getting MsDeploy path..."; [int]
原创 小問題 one of its dependencies
下面這種錯誤問題的引起是因爲 DLL build在32位系統下,然後你的系統和IIS默認情況下只允許64位的。解決這個問題很簡單,在你的項目Build屬性下把platform target 選成Any CPU從新build下工程即可解決問
原创 抽象類的應用
直接給出代碼: 首先是抽象類: public abstract class Request { public string BuildRequest() { string b
原创 System.BadImageFormatException:
System.BadImageFormatException: 引起這種異常的原因是應用程序本身不是有效的 Win32 應用程序,所以在你的項目屬性下把Plateform target 設置成x86即可。