I am looking for it recently. net and SAP interaction components, we found that BizTalk adapter pack has for mysap components, but the 120-day trial, although I have only made a solution, but I hope the time limit can be longer. so I took it and studied it.
By decompiling several key components, we finally found its time detection code. As follows:
Private Static datetime getexpirydate () <br/>{< br/> registrykey key = registry. localmachine. opensubkey (@ "software/Microsoft/BizTalk adapter pack/2.0/registration"); <br/> byte [] encrypteddata = (byte []) Key. getvalue ("Application Data"); <br/> string S = "89d87365-ed2b-4f58-81c4-f42987dc1433"; <br/> byte [] bytes = encoding. ASCII. getbytes (s); <br/> byte [] DATA = protecteddata. unprotect (encrypteddata, bytes, dataprotectionscope. localmachine); </P> <p> return New datetime (bitconverter. toint64 (data, 0); <br/>}
Obviously, it writes the expiration time in the Registry and is encrypted.
According to the above Code, write a corresponding registration code and change the expiration time to 9999-12-31 23:59:59, as shown below:
Private Static void setexpirydate (datetime DT) <br/>{< br/> string S = "89d87365-ed2b-4f58-81c4-f42987dc1433"; <br/> byte [] bytes = encoding. ASCII. getbytes (s); <br/> byte [] DATA = bitconverter. getbytes (DT. tobinary (); <br/> byte [] encrypteddata = protecteddata. protect (data, bytes, dataprotectionscope. localmachine); <br/> registrykey = registry. localmachine. opensubkey (@ "software/Microsoft/BizTalk adapter pack/2.0/registration", true); <br/> key. setvalue ("Application Data", encrypteddata, registryvaluekind. binary); <br/>}< br/> static void main (string [] ARGs) <br/>{< br/> console. writeline (getexpirydate (). tostring (); <br/> setexpirydate (datetime. maxvalue); <br/> console. read (); <br/>}
Note: A severe warning is reported here only for study purposes, and is not liable for any losses or other purposes.