H huhuc Unregistered / Unconfirmed GUEST, unregistred user! 2005-09-07 #1 金山词霸(2.0-2000版本)内有gb2py.idx和gbk2py.idx,<br>能不能Mail我一份,huhuc@tom.com
H huhuc Unregistered / Unconfirmed GUEST, unregistred user! 2005-09-07 #2 金山词霸(2.0-2000版本)内有gb2py.idx和gbk2py.idx,<br>能不能Mail我一份,huhuc@tom.com
H huhuc Unregistered / Unconfirmed GUEST, unregistred user! 2005-09-08 #4 下面上Delphi写的gb2py函数。<br>function gb2py(hanzichar)char;<br>var<br>Sfile:Tmemorystream;<br>pos,temp,ipos,len:integer;<br>py:array[0..20] of char;<br>begin<br> pos:=($fe-$a1)*(ord(hanzi[0])-$b0)+ord(hanzi[1])-$a1;<br> sfile:=Tmemorystream.create;<br> sfile.loadfromfile('C:/Program Files/KINGSOFT/XDICT/gb2py.idx');<br> //data:=sfile.memory;<br> sfile.Seek($1608+pos*4,soFromBeginning);<br> sfile.Read(ipos,4);<br> sfile.Read(temp,4);<br> len:=temp-ipos;<br> sfile.Seek(ipos+1,soFromBeginning);<br> sfile.Read(py,len);<br> py[len-1]:=#0;<br> sfile.Free;<br> result:=py;<br>end;
下面上Delphi写的gb2py函数。<br>function gb2py(hanzichar)char;<br>var<br>Sfile:Tmemorystream;<br>pos,temp,ipos,len:integer;<br>py:array[0..20] of char;<br>begin<br> pos:=($fe-$a1)*(ord(hanzi[0])-$b0)+ord(hanzi[1])-$a1;<br> sfile:=Tmemorystream.create;<br> sfile.loadfromfile('C:/Program Files/KINGSOFT/XDICT/gb2py.idx');<br> //data:=sfile.memory;<br> sfile.Seek($1608+pos*4,soFromBeginning);<br> sfile.Read(ipos,4);<br> sfile.Read(temp,4);<br> len:=temp-ipos;<br> sfile.Seek(ipos+1,soFromBeginning);<br> sfile.Read(py,len);<br> py[len-1]:=#0;<br> sfile.Free;<br> result:=py;<br>end;