Licence.cs
21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
using System;
using System.IO;
using System.Data;
using System.Security.Cryptography;
using System.Text;
using System.Collections;
using System.Xml;
using System.Runtime.InteropServices;
namespace App
{
/// <summary>
/// Licence µÄժҪ˵Ã÷¡£
/// </summary>
//[ClassInterfaceAttribute(ClassInterfaceType.AutoDual)]
public class Licence
{
private const string PublicKey = "<RSAKeyValue><Modulus>wD+BfPFh06qyNMMjyIZfbSeNSVGppoH4VCR6iVTnsrWm+Czjg24EycKvQfZd9SVYHJMASHuKr0VlBCPye2REs2b9UCT3b+yLqhFrde0v7k6m6FTZe4kH4USmhsQaJstcU94LCRDM3PNfWS3r9qZ11ZtJDmrGH1zFtOJsYBWdZAM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
private DataSet m_ds;
private string m_signStr;
private const string TABLENAME = "Value";
// »ñȡӲÅÌÎïÀíÐòÁкÅ
[DllImport("DiskSerialNo.dll")]
private static extern string GetDiskSerialNo();
// »ñÈ¡Íø¿¨ÐòÁкÅ
[DllImport("DiskSerialNo.dll")]
private static extern string GetMacAddr();
/// <summary>
/// »ñÈ¡»úÆ÷Ψһ±êÖ¾
/// </summary>
/// <returns>»úÆ÷Ψһ±êÖ¾</returns>
public static string GetDiskID()
{
string identity = String.Empty;
try
{
identity = GetMacAddr().Trim();
if (!String.IsNullOrEmpty(identity))
{
identity = "MA-" + identity;
return identity;
}
identity = GetDiskSerialNo().Trim();
if (!String.IsNullOrEmpty(identity))
{
identity = "HD-" + identity;
return identity;
}
//identity = GetCPUId();
//if (String.IsNullOrEmpty(identity))
//{
// identity = "CPU-" + identity;
//}
}
catch
{
throw;
}
return identity;
}
/// <summary>
/// »ñÈ¡±¾»úCPUID
/// </summary>
private static string GetCPUId()
{
String HDid = String.Empty;
//ManagementClass cimobject = new ManagementClass("Win32_Processor");
//try
//{
// ManagementObjectCollection moc = cimobject.GetInstances();
// foreach (ManagementObject mo in moc)
// {
// //HDid = mo["UniqueId"].ToString().Trim();
// //if (!String.IsNullOrEmpty(HDid))
// // break;
// }
//}
//catch
//{
// throw;
//}
return HDid;
}
#region Old
/*
// xfpan [5/31/2004]
private string m_LicencePath = "";
private string m_SignedString = "";
//private string PUBLICKEY = "<RSAKeyValue><Modulus>wD+BfPFh06qyNMMjyIZfbSeNSVGppoH4VCR6iVTnsrWm+Czjg24EycKvQfZd9SVYHJMASHuKr0VlBCPye2REs2b9UCT3b+yLqhFrde0v7k6m6FTZe4kH4USmhsQaJstcU94LCRDM3PNfWS3r9qZ11ZtJDmrGH1zFtOJsYBWdZAM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
private string PUBLICKEY = "<RSAKeyValue><Modulus>wD+BfPFh06qyNMMjyIZfbSeNSVGppoH4VCR6iVTnsrWm+Czjg24EycKvQfZd9SVYHJMASHuKr0VlBCPye2REs2b9UCT3b+yLqhFrde0v7k6m6FTZe4kH4USmhsQaJstcU94LCRDM3PNfWS3r9qZ11ZtJDmrGH1zFtOJsYBWdZAM=</Modulus><Exponent>AQAB</Exponent><P>7NMGb03H7zLLLYZ71RTKte6mJ7TonQfzx6qYmRCCwBsESolDoAInJBe07iFsQ324BCMFNcNrguHaRXH9KDkmow==</P><Q>z9B9NJ3fpMsBNv+J8ynaI18gQHBFcQeRRZw6hnGvN23xeIhf+G2i9RJUPHksY+xc5LVsyMc5gcq/LzeaRD6DIQ==</Q><DP>vwHsvLTlPt2e1dcT5WZhoJ8c0AWvX4fcbPwBG+MfMcYYje1r55AU9Z1RRocahMzPMDb2qsg03FlA7KXlYx3FNQ==</DP><DQ>co281upHw7FbxBNs2auyYVkokBzTSpEfVT3fTQkRyv5B421ZaboV3/3wjT1GaPZ75l7TzoFzg8ZdSQvfb8r9wQ==</DQ><InverseQ>D3R8Pf6C+4C3iS2eqr4CqYyISuIP/YDFm2lIUFJS+jkqOZNv47/IIWXbY4nGK2qpzwjDtcFyO1DiHhOaEMqd8A==</InverseQ><D>CicQao3A0dHQ6XJowF1ASt5s2rNiVzXD7IWkpv4B4nEvaSnNthIoVJNgeAZPvfOD7LZirHFByLHMfOR9GMEZ05wgc+lYuvLaQxuvXjXFPFDjLSR3/SOCXDRcbHtDvx00q2KXSyGJIMa/TANw15rxfvKtecVJetOON+GbCMfOA0E=</D></RSAKeyValue>";
UnicodeEncoding ByteConverter = new UnicodeEncoding();
private bool _IsLoad = false;
private bool _IsValidated = false;
private string _LastErrorInfo = "";
private const string TABLENAME = "Value";
public const string PRODUCTNAME = "MyCMMI2007"; //×¢²á²úÆ·µÄ名称,ÓÃÓÚÐí¿ÉÖ¤µÄÑéÖ¤ m_dt.Columns.Add("ConfigueDepot", typeof(System.String));
}
/// <summary>
/// ÑéÖ¤Ó²¼þÐòÁкÅ
/// </summary>
/// <returns>ÑéÖ¤³É¹¦Îªtrue,²»³É¹¦Îªfalse</returns>
public bool ValidateSerialNo()
{
String DiskID = GetValidateInfo("DiskID");
WriteLog("The DiskID is " + DiskID + " that read from licensefile");
String DiskSn = GetDiskID();
WriteLog("The DiskID is " + DiskSn + " that read from hardware");
if (DiskID == "" || DiskSn == "" || DiskSn == null || DiskID != DiskSn)
{
WriteLog("The DiskID of licensefile (" + DiskID + ") is not equal of the DiskID of hareware (" + DiskSn + ")");
_LastErrorInfo = "The DiskID of licensefile (" + DiskID + ") is not equal of the DiskID of hareware (" + DiskSn + ")";
// ϵͳδע²á
return false;
}
return true;
}
/// <summary>
/// »ñÈ¡»úÆ÷Ψһ±êÖ¾
/// </summary>
/// <returns>»úÆ÷Ψһ±êÖ¾</returns>
public string GetDiskID()
{
string DiskID = "";
DiskID = GetMAC().Trim();
if (DiskID != "")
{
DiskID = "MA-" + DiskID;
return DiskID;
}
WriteLog("MAC ID is null");
try
{
DiskID = GetDiskSerialNo().Trim();
if (DiskID != "")
{
DiskID = "HD" + DiskID;
return DiskID;
}
WriteLog("HD ID is null");
}
catch (Exception de)
{
_LastErrorInfo = "Getting DiskSerialNo,catch a exception.It's information that " + de.Message.ToString();
WriteLog("Getting DiskSerialNo,catch a exception.It's information that " + de.Message.ToString());
}
DiskID = GetCPUId();
if (DiskID != "")
{
DiskID = "CP" + DiskID;
return DiskID;
}
WriteLog("CPU ID is null");
return "";
}
private string GetCPUId()
{
String HDid = "";
ManagementClass cimobject = new ManagementClass("Win32_Processor");
try
{
ManagementObjectCollection moc = cimobject.GetInstances();
foreach (ManagementObject mo in moc)
{
HDid = mo["UniqueId"].ToString();
if (HDid != "")
break;
}
}
catch (Exception he)
{
WriteLog("When getting CPU ID,catch a exception.It's message that " + he.Message.ToString());
_LastErrorInfo = "When getting CPU ID,catch a exception.It's message that " + he.Message.ToString();
HDid = "";
}
return HDid.Trim();
}
private string GetMAC()
{
string strMac = "";
try
{
strMac = GetMacAddr();
}
catch (Exception me)
{
WriteLog("When getting Mac Address,catch a exception.It's message that " + me.Message.ToString());
_LastErrorInfo = "When getting Mac Address,catch a exception.It's message that " + me.Message.ToString();
strMac = "";
}
return strMac.Trim();
}
/// <summary>
/// ÑéÖ¤Ðí¿Éʱ¼ä
/// </summary>
/// <returns>ÑéÖ¤³É¹¦Îªtrue,²»³É¹¦Îªfalse</returns>
public bool ValidateDate()
{
string CurrentDate = System.DateTime.Now.ToShortDateString();
string FromDate = GetValidateInfo("FromDate");
string ToDate = GetValidateInfo("ToDate");
if (Convert.ToDateTime(CurrentDate) < Convert.ToDateTime(FromDate))
{
_LastErrorInfo = "Ðí¿ÉÖ¤ÔÊÐíʹÓÃÈÕÆÚÉÐδ¿ªÊ¼";
return false;
}
if (Convert.ToDateTime(CurrentDate) > Convert.ToDateTime(ToDate))
{
_LastErrorInfo = "Ðí¿ÉÖ¤ÒѹýÆÚ";
return false;
}
return true;
}
/// <summary>
/// ÑéÖ¤Ðí¿ÉÖ¤Îļþ
/// </summary>
/// <returns>ÑéÖ¤³É¹¦Îªtrue,²»³É¹¦Îªfalse</returns>
public bool ValidateAuthority()
{
string f_UnSignedInfo = "";
if (m_SignedString == "" || m_ds == null || m_ds.Tables[TABLENAME] == null || m_ds.Tables[TABLENAME].Rows.Count != 1)
{
return false;
}
string colName = string.Empty;
for (int i = 0; i < m_ds.Tables[TABLENAME].Columns.Count; i++)
{
colName = m_ds.Tables[TABLENAME].Columns[i].ColumnName;
f_UnSignedInfo += colName;
if (colName == "DiskID")
f_UnSignedInfo += GetDiskID();
else
f_UnSignedInfo += m_ds.Tables[TABLENAME].Rows[0][i].ToString().Trim();
}
//f_UnSignedInfo = "DiskIDMA-00-15-58-E8-CC-E4";//yyb
byte[] UnSignedInfoByte = ByteConverter.GetBytes(f_UnSignedInfo);
byte[] SignedInfoByte = Convert.FromBase64String(m_SignedString);
try
{
//CspParameters CSPParam = new CspParameters();
//CSPParam.Flags = CspProviderFlags.UseMachineKeyStore;
//RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(CSPParam);
//RSA.FromXmlString(PUBLICKEY);
//HashAlgorithm sha = new SHA1CryptoServiceProvider();
//IsValidated = RSA.VerifyData(UnSignedInfoByte, sha, SignedInfoByte);
IsValidated = VerifySignedHash(UnSignedInfoByte, SignedInfoByte);
}
catch
{
return false;
}
return IsValidated;
}
/// <summary>
/// »ñÈ¡Ðí¿ÉÖ¤ÐÅÏ¢
/// </summary>
/// <param name="f_ValidateKey">Ðí¿ÉÖ¤ÐÅÏ¢Ö÷¼ü</param>
/// <returns>Ðí¿ÉÖ¤ÐÅÏ¢¶ÔÓ¦Öµ</returns>
private string GetValidateInfo(string f_ValidateKey)
{
string f_ValidateInfo = "";
if (m_ds == null || m_ds.Tables[TABLENAME] == null || m_ds.Tables[TABLENAME].Rows.Count != 1 || m_ds.Tables[TABLENAME].Columns[f_ValidateKey] == null)
{
f_ValidateInfo = "";
}
else
{
try
{
f_ValidateInfo = m_ds.Tables[TABLENAME].Rows[0][f_ValidateKey].ToString();
}
catch
{
f_ValidateInfo = "";
}
}
return f_ValidateInfo;
}
/// <summary>
/// ¼ÓÔØÊÇ·ñ³É¹¦±êÖ¾
/// </summary>
public bool IsLoad
{
get
{
return _IsLoad;
}
set
{
_IsLoad = value;
}
}
/// <summary>
/// ÑéÖ¤ÊÇ·ñ³É¹¦±êÖ¾
/// </summary>
public bool IsValidated
{
get
{
return _IsValidated;
}
set
{
_IsValidated = value;
}
}
// ²âÊÔʹÓÃ
private void WriteLog(String ErrInfos)
{
FileStream fs;
StreamWriter sw;
try
{
fs = new FileStream("c:\\ErrorLog.txt", FileMode.OpenOrCreate | FileMode.Append);
sw = new StreamWriter(fs);
sw.WriteLine(DateTime.Now.ToString() + " " + ErrInfos);
sw.Close();
}
catch { }
}
/// <summary>
/// ×îºóµÄ´íÎóÐÅÏ¢
/// </summary>
public string LastErrorInfo
{
get
{
return _LastErrorInfo;
}
set
{
_LastErrorInfo = value;
}
}
/// <summary>
/// ÑéÖ¤£¬°üÀ¨ÑéÖ¤ÊÇ·ñ¼ÓÔØ³É¹¦¡¢Ðí¿ÉÖ¤ÎļþÊÇ·ñÓÐЧ¡¢Ê±¼äÊÇ·ñÔÚÓÐЧÆÚÄÚ¡¢ÐòÁкÅÊÇ·ñÕýÈ·
/// </summary>
/// <param name="f_LicencePath">Ðí¿É֤·¾¶</param>
/// <param name="ProductName">²úÆ·名称</param>
/// <returns>ÑéÖ¤³É¹¦Îªtrue,²»³É¹¦Îªfalse</returns>
public bool Validate(string f_LicencePath)
{
Initialize(f_LicencePath);
// ÑéÖ¤ÊÇ·ñ¼ÓÔØ³É¹¦
if (_IsLoad == false)
{
_LastErrorInfo = "¼ÓÔØÐí¿ÉÖ¤Îļþʧ°Ü";
return false;
}
// ÑéÖ¤Ðí¿ÉÖ¤ÎļþÊÇ·ñÓÐЧ
if (!ValidateAuthority())
{
_LastErrorInfo = "ÑéÖ¤Ðí¿ÉÖ¤Îļþʧ°Ü";
return false;
}
// Ñé֤ʱ¼äÊÇ·ñÔÚÓÐЧÆÚÄÚ
if (!ValidateDate())
{
// ´íÎóÐÅÏ¢ÔڵײãÒѾ¸ø³ö
return false;
}
// ÑéÖ¤ÐòÁкÅÊÇ·ñÕýÈ·
if (!ValidateSerialNo())
{
// ´íÎóÐÅÏ¢ÔڵײãÒѾ¸ø³ö
return false;
}
// ÑéÖ¤²úÆ·名称ÊÇ·ñÕýÈ·
if (!ValidateProductName())
{
// ´íÎóÐÅÏ¢ÔڵײãÒѾ¸ø³ö
return false;
}
// ÑéÖ¤³É¹¦
return true;
}
/// <summary>
/// УÑé²úÆ·名称
/// </summary>
/// <param name="ProductName">²úÆ·名称</param>
/// <returns>·µ»ØÖµ,ÕýÈ··µ»Øtrue,´íÎó·µ»Øfalse</returns>
public bool ValidateProductName()
{
string curProductName = PRODUCTNAME;
string ProName = GetValidateInfo("ProductName").Trim();
if (ProName != curProductName)
{
_LastErrorInfo = "´íÎóÐÅÏ¢:ÇëʹÓÃÕýÈ·µÄÐí¿ÉÖ¤,µ±Ç°ÔËÐеIJúƷΪ'" + curProductName + "',¶øÊ¹ÓõÄÊDzúƷΪ'" + ProName + "'µÄÐí¿ÉÖ¤";
return false;
}
return true;
}
*/
#endregion
public Licence()
{
InitDataSet();
}
private void InitDataSet()
{
m_ds = new DataSet();
DataTable m_dt = m_ds.Tables.Add(TABLENAME);
m_dt.Columns.Add("DiskID", typeof(System.String));
m_dt.Columns.Add("CompanyName", typeof(System.String));
m_dt.Columns.Add("UserCount", typeof(System.String));
m_dt.Columns.Add("ProductName", typeof(System.String));
m_dt.Columns.Add("Version", typeof(System.String));
m_dt.Columns.Add("FromDate", typeof(System.String));
m_dt.Columns.Add("ToDate", typeof(System.String));
m_dt.Columns.Add("ConfigueDepot", typeof(System.String));
}
/// <summary>
/// ¼ÓÔØÐí¿ÉÖ¤Îļþ
/// </summary>
private bool LoadLicenceFile(string licencePath)
{
if (!File.Exists(licencePath))
{
//Îļþ²»´æÔÚ
return false;
}
XmlDocument doc = new XmlDocument();
try
{
doc.Load(licencePath);
m_ds.Tables[TABLENAME].Clear();
DataRow dr = m_ds.Tables[TABLENAME].NewRow();
foreach (XmlNode node in doc.FirstChild.ChildNodes)
{
if (node.Attributes.Count == 2)
dr[node.Attributes["key"].Value.Trim()] = node.Attributes["value"].Value;
}
m_ds.Tables[TABLENAME].Rows.Add(dr);
m_signStr = doc.FirstChild.LastChild.Attributes["SignInfo"].Value;
}
catch
{
return false;
}
return true;
}
/// <summary>
/// Ç©ÃûÑéÖ¤
/// </summary>
/// <param name="unSignedByte">Ç©ÃûǰµÄÐÅÏ¢</param>
/// <param name="signedByte">Ç©ÃûºóµÄÐÅÏ¢</param>
private bool VerifySignedHash(byte[] unSignedByte, byte[] signedByte)
{
try
{
RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider();
RSAalg.FromXmlString(PublicKey);
return RSAalg.VerifyData(unSignedByte, new SHA1CryptoServiceProvider(), signedByte);
}
catch
{
return false;
}
}
/// <summary>
/// ÑéÖ¤Ðí¿ÉÖ¤Îļþ
/// </summary>
public bool VerifySigned(string licencePath)
{
if (!LoadLicenceFile(licencePath))
return false;
if (String.IsNullOrEmpty(m_signStr) || m_ds == null || m_ds.Tables[TABLENAME] == null || m_ds.Tables[TABLENAME].Rows.Count != 1)
{
return false;
}
StringBuilder unSignedStr = new StringBuilder();
string colName = string.Empty;
for (int i = 0; i < m_ds.Tables[TABLENAME].Columns.Count; i++)
{
colName = m_ds.Tables[TABLENAME].Columns[i].ColumnName;
unSignedStr.Append(colName);
if (colName == "DiskID")
unSignedStr.Append(GetDiskID());
else
unSignedStr.Append(m_ds.Tables[TABLENAME].Rows[0][i].ToString().Trim());
}
try
{
UnicodeEncoding ByteConverter = new UnicodeEncoding();
byte[] unSignedByte = ByteConverter.GetBytes(unSignedStr.ToString());
byte[] signedByte = Convert.FromBase64String(m_signStr);
return VerifySignedHash(unSignedByte, signedByte);
}
catch
{
return false;
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеÄÓ²ÅÌÐòÁкÅ
public string GetDiskIDFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["DiskID"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеĹ«Ë¾名称
public string GetCompanyNameFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["CompanyName"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеÄÓû§ÊýÁ¿
public string GetUserCountFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["UserCount"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеIJúÆ·名称
public string GetProductNameFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["ProductName"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤Öеİ汾ºÅ
public string GetVersionFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["Version"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеÄÅäÖÿâÐÅÏ¢
public string GetConfigueDepot()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["ConfigueDepot"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеÄÓÐЧÆÚµÄÆôÆðÈÕÆÚ
public string GetFromDateFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["FromDate"].ToString().Trim();
}
catch
{
return "";
}
}
//»ñÈ¡Ðí¿ÉÖ¤ÖеÄÓÐЧÆÚµÄ½ØÖ¹ÈÕÆÚ
public string GetToDateFromLicence()
{
try
{
return m_ds.Tables[TABLENAME].Rows[0]["ToDate"].ToString().Trim();
}
catch
{
return "";
}
}
}
}