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

    摘要: 用什么方法可以判断指定的路径是否合法?例如路径是c:\backup,却错写成c;/backup,这时候有什么函数可以返回一个真值或假值来判断此路径是否合法??请指教!!! ......
    摘要: rt: 小弟感激不尽! ......


高分紧求助:运行一个程序前判断该程序是否已经运行,如果运行则不再运行怎样判断

高分紧急求助:运行一个程序前判断该程序是否已经运行,如果运行则不再运行!怎样判断??

NO.1   作者: jinjazz

var  
      hmutex:hwnd;  
      ret:integer;  
  begin  
      Application.Initialize;  
      hmutex:=createmutex(nil,false,project1);  
      ret:=getlasterror;  
      if   ret<>error_already_exists   then  
      begin  
      Application.CreateForm(TForm1,   Form1);  
      end  
      else  
      begin  
      messagedlg(程序已运行。,mtinformation,[mbok],0);  
      releasemutex(hmutex);  
      end;  
 

NO.2   作者: xixuemao

program   Project1;  
   
  uses  
      Forms,  
      Windows,  
      Unit1   in   Unit1.pas   {Form1};  
   
  {$R   *.res}  
  var  
          hMutex:hWnd;  
  begin  
      Application.Initialize;  
      Application.Title:=test;  
      hMutex:=CreateMutex(nil,false,test);  
      if   GetLastError<>Error_Already_Exists   then  
      begin  
          Application.CreateForm(TForm1,   Form1);  
          Application.Run;  
      end  
      else  
      begin  
          Application.MessageBox(本程序只允许同时运行一个,Error);  
          ReleaseMutex(hMutex);  
      end;  
  end.


 ·盼解决在线等待    »显示摘要«
    摘要: 我在窗体上加了一地图!想在窗体扩大缩小的时候在上面画图形!使图形之间的距离随着地图的扩大比例而同比例扩大!而图形的大小不改变!该怎么样做呢?图形我会画的,只求怎样改变图形之间的距离????最好给我一点用vb.net写的代码????救命!!!!help!help!help! ......
» 本期热门文章:

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