求教如何动态控制文件夹的共享(95/98)下。分数不多,见笑。(300分)

  • 主题发起人 主题发起人 FLY_IN_SKY
  • 开始时间 开始时间
F

FLY_IN_SKY

Unregistered / Unconfirmed
GUEST, unregistred user!
如题<br>我是新手,望详细一点,万分感谢!
 
打开注册表,看这里<br>HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Network/LanMan<br><br>都在这里了,不过修改后要重起才起作用.<br>
 
可不可以不重起啊?<br>应该有api可以解决吧?
 
另外那些键值是什么意思??
 
让我告诉你吧!我发到你的信箱里。
 
To R_Baggio:<br>&nbsp; &nbsp;windinsky@yeah.net<br>&nbsp; &nbsp;<br>&nbsp; &nbsp; Thanks
 
R_Baggio<br>邮件以收到,不过总是调不通,如何调用Netshareadd??能否说的详细点,或者发个例子程序给我。<br>多谢!
 
给我一份:Knight98@263.net
 
一个VC的例子<br><br>void wmain( int argc, TCHAR *argv[ ])<br>{<br>&nbsp; &nbsp;NET_API_STATUS res;<br>&nbsp; &nbsp;SHARE_INFO_2 p;<br>&nbsp; &nbsp;DWORD parm_err = 0;<br><br>&nbsp; &nbsp;if(argc&lt;2)<br>&nbsp; &nbsp; &nbsp; printf("Usage: NetShareAdd server/n");<br>&nbsp; &nbsp;else<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; // Fill in the SHARE_INFO_2 structure.<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; p.shi2_netname = TEXT("TESTSHARE"); &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; p.shi2_type = STYPE_DISKTREE; // disk drive<br>&nbsp; &nbsp; &nbsp; p.shi2_remark = TEXT("TESTSHARE to test NetShareAdd");<br>&nbsp; &nbsp; &nbsp; p.shi2_permissions = 0; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; p.shi2_max_uses = 4;<br>&nbsp; &nbsp; &nbsp; p.shi2_current_uses = 0; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; p.shi2_path = TEXT("C://");<br>&nbsp; &nbsp; &nbsp; p.shi2_passwd = NULL; // no password<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; // Call the NetShareAdd function,<br>&nbsp; &nbsp; &nbsp; // &nbsp;specifying level 2.<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; res=NetShareAdd(argv[1], 2, (LPBYTE) &amp;p, &amp;parm_err);<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; // If the call succeeds, inform the user.<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; if(res==0)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf("Share created./n");<br>&nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; // Otherwise, print an error,<br>&nbsp; &nbsp; &nbsp; // &nbsp;and identify the parameter in error.<br>&nbsp; &nbsp; &nbsp; //<br>&nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf("Error: %u/tparmerr=%u/n", res, parm_err);<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;return;<br>}<br>
 
有知识大家听嘛tingweb@wx88.net
 
我也想要一份:<br>h@sun.net.cn
 
我认为也要注意这里<br>HKEY_LOCAL_MACHINE/Security
 
十分感谢R_Baggio,问题已经解决.收分...
 
多人接受答案了。
 
各位高手:像disklock之类的加密磁盘目录的工具是什么原理?
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
559
import
I
后退
顶部