CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Delphi >  网络通信/分布式开发

在DELPHI中映射网络驱动器

楼主heyongzhou()2001-06-22 14:14:00 在 Delphi / 网络通信/分布式开发 提问

有没有什么API提供映射?  
  我在MSDN中一堆API中哭哭追寻,却找不到她的芳影。痛苦!  
   
  倒是发现一个接口,IWshNetwork   ,可是我不会用。  
  她的有关文档是  
   
   
  Microsoft®   Windows®   Script   Host  
  MapNetworkDrive   Method     WSH   Reference  
  Version   1      
   
  See   Also                                             Applies   To    
   
   
  --------------------------------------------------------------------------------  
   
  Description  
  Maps   the   share   point   specified   by   strRemoteName   to   the   local   resource   name   strLocalName.    
  Syntax  
  object.MapNetworkDrive   strLocalName,   strRemoteName,   [bUpdateProfile],   [strUser],   [strPassword]    
  Parameters  
  Part   Description    
  object   WshNetwork   object.    
  strLocalName   Local   resource   name.    
  strRemoteName   Remote   share   to   map.    
  bUpdateProfile   Optional.   If   bUpdateProfile   is   supplied   and   its   value   is   TRUE,   the   mapping   is   stored   in   the   user   profile.   The   default   is   FALSE.    
  strUser,   strPassword   Optional.   If   you   are   mapping   the   share   point   using   the   credentials   of   someone   other   than   current   user,   you   can   specify   strUser   and   strPassword.    
   
  Example  
  The   following   example   shows   how   to   map   the   "Z"   drive   to   a   network   share:    
  Set   WshNetwork   =   WScript.CreateObject("WScript.Network")  
  WshNetwork.MapNetworkDrive   "Z:",   "\\Server\Share"  
   
   
  这大概是VB的玩意吧,谁把她翻译成DELPHI? 问题点数:28、回复次数:2Top

1 楼hzwjs(无聊)回复于 2001-06-22 14:30:00 得分 28

procedure   TForm1.Button1Click(Sender:   TObject);  
  var  
      NRW:   TNetResource;  
  begin  
      with   NRW   do  
      begin  
          dwType   :=   RESOURCETYPE_ANY;  
          lpLocalName   :=   'X:';   //   map   to   this   driver   letter  
          lpRemoteName   :=   '\\MyServer\MyDirectory';  
          //   Must   be   filled   in.     If   an   empty   string   is   used,  
          //   it   will   use   the   lpRemoteName.  
          lpProvider   :=   '';  
      end;  
      WNetAddConnection2(NRW,   'MyPassword',   'MyUserName',  
          CONNECT_UPDATE_PROFILE);  
  end;  
  Top

2 楼zxb2001(zxb)回复于 2001-06-24 20:42:00 得分 0

gzTop

相关问题

  • 映射网络驱动器
  • ???映射网络驱动器的问题???
  • 关于网络映射驱动器
  • 怎样映射网络驱动器
  • 映射网络驱动器出错
  • 想要映射网络驱动器的源码和断开映射网络驱动器的源码
  • 用什么API函数能实现映射网络驱动器?
  • CB中如何实现网络驱动器的映射?
  • DOS下能否使用映射的网络驱动器?
  • 如何在PB中映射网络驱动器呢?

关键词

  • bupdateprofile
  • nrw
  • strremotename
  • strlocalname
  • struser
  • strpassword
  • map
  • share

得分解答快速导航

  • 帖主:heyongzhou
  • hzwjs

相关链接

  • Delphi类图书
  • Delphi类源码下载
  • Delphi控件下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo