有必要这样做吗?是不是相反了?应该在程序中控制联接才对啊

解决方案 »

  1.   

    不成的,不管你怎么控制链接,你在服务器上的真实地址总是存在的,别人是有机会找到的,只有改了名就没办法了
    或者改目录名也可以,我没做过,请各位指点
      

  2.   

    1.改名函数原形:procedure Rename(var F; Newname: string);事例程序
    var  f : file;
    begin
    Rename(f, 'file new name');
    end;
    2.搜索目录查找指定文件的函数
      FindFirst, FindNext, FindClose
    事例程序:
      procedure TForm1.Button1Click(Sender: TObject);var
      sr: TSearchRec;
      FileAttrs: Integer;
    begin
      StringGrid1.RowCount := 1;
      if CheckBox1.Checked then
        FileAttrs := faReadOnly
      else
        FileAttrs := 0;
      if CheckBox2.Checked then
        FileAttrs := FileAttrs + faHidden;
      if CheckBox3.Checked then
        FileAttrs := FileAttrs + faSysFile;
      if CheckBox4.Checked then
        FileAttrs := FileAttrs + faVolumeID;
      if CheckBox5.Checked then    FileAttrs := FileAttrs + faDirectory;
      if CheckBox6.Checked then
        FileAttrs := FileAttrs + faArchive;
      if CheckBox7.Checked then    FileAttrs := FileAttrs + faAnyFile;  with StringGrid1 do
      begin
        RowCount := 0;    if FindFirst(Edit1.Text, FileAttrs, sr) = 0 then    begin
          repeat
            if (sr.Attr and FileAttrs) = sr.Attr then
            begin
            RowCount := RowCount + 1;
            Cells[1,RowCount-1] := sr.Name;
            Cells[2,RowCount-1] := IntToStr(sr.Size);
            end;
          until FindNext(sr) <> 0;
          FindClose(sr);
        end;
      end;
    end;
    3.只要这一步能够实现,那么修改修改mysql数据库中指向这个文件的链接,就比较简单了.