本文介绍了:: CreateFile失败,拒绝访问是shell编程或其他解决方案或提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我在互联网上的某个地方发现这个问题现在面临同样的问题。几乎没有变化我已经在下面修改了问题。
问题:
HiI found this question somewhere on internet now facing same problem. With little change i already have modfied question below.
Question:
I want to access a file on remote machine(10.10.20.30), but i couldnt understand how to login to that machine in my program. Is there any simple win api that takes network path, credentials and returns the handle of file? i just want to access \\10.10.20.30\share folder\test.txt.
Any suggestion will be helpful.
sorry for not being very clear in coding sense.
Detail:
I wanted to access a file that is shared in a shared folder but permission is not given to me. I am using <u><b>::CreateFile</b></u> to get the handel of the file . But in this case i am reciveing error code 5 (ACCESS_DENIED). i need to use user (my client) credential (username password) to access file which is shared. I just need handle of file.
告诉我,如果我错了:在这种情况下,通过使用或修改安全属性,不能使用CreateFile,如MSDN所述。
在打开现有文件时,CreateFile会忽略lpSecurityDescriptor成员。我还想过使用Window shell但无法重新编写解决方案。
Tell me if i am wrong ::CreateFile cannot be used in this case by using or modifying security attributes as MSDN says.
CreateFile ignores the lpSecurityDescriptor member when opening an existing file.I also thought of using Window shell but could not reched a solution.
Well the requirement is like this at remote machine i do not have EveryOne permission. Let me explain through an example. Suppose there is network with certain domain having atleast 3 computer lets say 5. Now there name are C1(client),C2(destination),C3,C4,C5. Now in this case i will create a file(any type) at C2 machine and will put that in a folder say MyFolder. Now make it share and after that and remove <big>EveryOne</big> from it. After that add C5 as user for accessing it. Now you can see write the some code with just ::CreateFile implementation and run it on both machine C1(client) and C5(it has permission). You will see client(C1) will get error 5 which means ACCESS_DENIED but C5 will execute it and will get the file handle......Now again i am repeating my question i need to get the file handle by any means through my user name and password, And my program will get the handle from that C1 machine..
请建议我
提前谢谢
Please advice me
Thanks in advance
推荐答案
这篇关于:: CreateFile失败,拒绝访问是shell编程或其他解决方案或提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!