function DenCrypt(Str : string; Key : string): string;  var  X, Y : Integer;  A : Byte;  begin  if Key = '' then  Key := 'xauujsj';  Y := 1;  for X := 1 to length(Str) do begin  //循环开始到字符长度值  A := (ord(Str[X]) and $0f) xor (ord(Key[Y]) and $0f);  //将Str[X]和Key[Y]的低四位进行异或
 Str[X] := char((ord(Str[X]) and $f0) + A); //保留str[X]的高四位的值,而将加密后的低四位的值回传到Str[X]  inc(Y); //就是Y:=Y+1
  if Y > length(Key) then  Y := 1;  end;  Result := Str;  end;
让他得到的字符串只是数字和字母!谢谢!

解决方案 »

  1.   

    那个不行看看这个了!
    MyReg  :=  TRegistry.Create;  
           MyReg.RootKey  :=  HKEY_LOCAL_MACHINE;  
             try  
                 if  MyReg.OpenKey('Software\tiku',false)  then  
                           begin  
     
                                     if  MyReg.ReadInteger('pwd')=1  then  
                                     begin  
                                       showmessage('¹þ¹þ£¡³É¹¦ÁË£¡')  ;  
                                       close;  
                                     end  
                                 end  
                         end  
                             else  
                             begin  
                             showmessage('ûÓÐ×¢²á£¡');  
     
                             end;  
                     MyReg.CloseKey;  
                 finally  
                 MyReg.Free;  
                 end;  
     
    这个是不是有问题啊?  
    我要让他开始判断“tiku”是否存在!如果存在则判断pwd是否为1,如果为1则关闭此form!      拜托
      

  2.   

    可是为什么在form   的 on creat 事件中不能用close将form关闭啊?
      

  3.   

    你如果是想判断符合某个条件才让程序运行的话,不应该将代码写在OnCreate事件中,应该在工程文件中进行判断例如:
       If CheckOK then
          Application.CreateForm( From1, TForm1 );
          Application.Run;
       End;
      

  4.   

    可是为什么在form   的 on creat 事件中不能用close将form关闭啊?a:那是因为form还没有创建,如果close,那么就会崩了,可以在onshow中close