当前位置:首页 » 服务器技术
开发技术指南» 文章正文
    引言:
 

 

    摘要:如何编写nt service在msdn->platform sdk->dlls, processes, and threads->service中说得很清楚了,在这里我就不多说了,这里我就只说一些我个人认为的在编写service过程中要注意的地方。 0、在我们通过控制面板或net start命令启动一个service时, service control manager (scm)从注册表里拿到service的可执行程序名,然后运行这个程序......
 ·使程序运行一个实例    »显示摘要«
    摘要:代码源自jeffry richter的著作《windows核心编程》 在initinstance()函数中写入以下代码: //只运行一个实例 handle happ = createmutex(null,false,"onlyoneinstanceexample"); if(getlasterror() == error_already_exists) { afxmessagebox("already exist an ins......


enoeht的Java源码系列(5)--字符串加解密
这一篇的内容是一个简单的对字符串加解密的类:

  【相关文章:QueryInterface XXXX

then call its encrypt or decrypt method with an authenticator byte array (the parameter auth which is a 16 octet byte array) and the data which is wanted to be encoded or decoded, the result is a byte array you wanted. 【扩展阅读:实例说明java中覆盖静态方法和非静态方

package org.kyle.util; 【扩展信息:CVSTrac简体中文Windows版

 

 

import java.security.*;

import java.io.*;

import java.text.*;

import java.util.*;

import java.math.*;

 

/*    call the shared secret s and the pseudo-random 128-bit

       authenticator ra.  break the password into 16-octet chunks p1, p2,

       etc.  with the last one padded at the end with nulls to a 16-octet

       boundary.  call the ciphertext blocks c(1), c(2), etc.  we´ll need

       intermediate values b1, b2, etc.

         b1 = md5(s + ra)       c(1) = p1 xor b1

         b2 = md5(s + c(1))     c(2) = p2 xor b2

                .                       .

                .                       .

                .                       .

         bi = md5(s + c(i-1))   c(i) = pi xor bi

       the string will contain c(1)+c(2)+...+c(i) where + denotes

       concatenation.

       on receipt, the process is reversed to yield the original

       password.

*/

public class cryptology

{

    /** hidden secret data for encryption and decryption. */

    private byte[] m_secret;

 

    /** default secret length. */

    private int m_defaultsecretlength = 256;

 

    /**

     * default constructor to create object with default hidden secret.

     */

    public cryptology()

    {

        m_secret = createsecret( m_defaultsecretlength, normalize( getclass().getname() ) );

    }

 

    /**

     * allow to use user desired hidden secret to instantiate this object.

     * @param    specsecret    the user desired hidden secret string.

     * @param    secretlen     the length of secret in bytes.

     */

    public cryptology( string specsecret, int secretlen )

    {

        if ( specsecret == null )

            specsecret = getclass().getname();


...   下一页
 ·泡泡堂单机版本 v2.0 工作计划    »显示摘要«
    摘要: 首先,感谢一些热心得朋友得来信,信中都表达了对游戏得热爱,对我得这个作品得关心。 其中一位叫做" 云在天 [cloudinsky@vip.sina.com] " 的朋友给予了我很多建议,基本上第二版本中必须实现的目标也和他雷同,信件部分内容如下: ~~~~~~~~~~~~~~~~~~~~~~ 首先,很感谢你得来信,详细得说了许多得不足得地方,我正在计划编写第二个版本,目前已经解决得问题我打上勾: √ 1,最好找个mm,把美术~~~~~......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE