当前位置:主页>仓库管理软件> 列表

江湖告急--CooKies网络编程 找人事管理系统软件

财务软件版1楼: 如何实现利用软件写入CooKies来使网页上能判断本地是否安装了本软件
当然网页上会配合软件来写
或者有什么 好的实现方法
谢谢各位了

2楼: 连续在线等待 如人事管理系统软件

3楼: 扑哧~~扑哧~~扑哧~~扑哧~~

4楼: 帮顶一下

5楼: 谢谢 帮顶~~~~~~~~`
有朋友能详细介绍一下用 Delphi 操作cookies的资料么?

6楼: function GetCookieFolder: string;
const
SCookieKey = ''\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'';
var
Reg: TRegistry;
begin
Reg := TRegistry.Create; Result := '''';
try Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey(SCookieKey, False) then Result := Reg.ReadString(''Cookies'');
finally Reg.Free;
end;
end;
function FindCookie(HostName, FileName : string):string;
var
Tsl : TStringList;
i : integer;
begin
Result:='''';
Tsl := TStringList.Create;
try Tsl.LoadFromFile(FileName);


except
end;
for i:=2 to Tsl.Count-1 do begin
if pos(HostName,Tsl[i])=1 then begin
if Result<>'''' then Result:=Result+'';'';
Result:= Result+Tsl[i-2]+''=''+Tsl[i-1];
end;
end;
Tsl.Free;
end;
function GetCookie( HostName: string ):string;
var
Found: Integer;
SearchRec: TSearchRec;
CookieFolder: string;
begin
HostName:=LowerCase(HostName);
CookieFolder := GetCookieFolder;
if (Copy(CookieFolder,Length(CookieFolder),1)<>''\'') then CookieFolder:=CookieFolder+''\'';
Found := FindFirst(CookieFolder + ''*.txt'', faAnyFile, SearchRec);
while Found = 0 do begin
if (SearchRec.Attr and faDirectory) = 0 then begin
Result:=FindCookie(HostName, CookieFolder + SearchRec.Name);
if Result<>'''' then break;
end;
Found := FindNext(SearchRec);
end;
FindClose(SearchRec);
end;

win2000下使用正常,其他系统未测试过。
使用: cookies:=GetCookie(''163.com'');

财务软件版7楼: 谢谢 skadon
那请问一下怎么写入cookies?

8楼: GetCookie()里调用了FindCookie(),如果有返回数据,那么已经找到保存cookie的文件了,改写这个文件就可以了,具体格式我没有去看,可以参考FindCookie()部分修改

9楼: 谢谢了 skadon
能留下你的QQ么?
或者加我的QQ:29735937

10楼: 请问能操作cookies里面的一些属性的值么?