29 lines
		
	
	
		
			708 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			29 lines
		
	
	
		
			708 B
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Runtime.Serialization; | |||
|  | using System.ServiceModel; | |||
|  | using System.Text; | |||
|  | 
 | |||
|  | namespace DeiNiu.Wcf | |||
|  | { | |||
|  |     // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码、svc 和配置文件中的类名“Configuration”。 | |||
|  |     public class ConfigurationService : IConfiguration | |||
|  |     { | |||
|  |         public string getDbConn() | |||
|  |         { | |||
|  | 
 | |||
|  |             string connectionString = System.Configuration.ConfigurationManager.AppSettings["SqlConnectionString"]; | |||
|  | #if DEBUG | |||
|  | 
 | |||
|  |             return connectionString; | |||
|  | 
 | |||
|  | #else          | |||
|  |               | |||
|  |            return DESEncrypt.Encrypt(connectionString); | |||
|  | #endif | |||
|  | 
 | |||
|  |         } | |||
|  |     } | |||
|  | } |