-
如何获取共享文件的路径
2008-01-15 14:47:00using System; using System.Management; namespace ConsoleApplication1 { /// /// Class1 的摘要说明。 /// class Class1 { /// /// 应用程序的主入口点。using System;
using System.Management;
namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
ManagementObjectSearcher searcher = new
ManagementObjectSearcher("select * from win32_share");
foreach (ManagementObject share in searcher.Get())
{
Console.WriteLine(share["Name"].ToString()); //名称
Console.WriteLine(share["Path"].ToString()); //路径
}
}
}
}注册表中有:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/Shares不知从select * from win32_share还可以得到其它什么属性
应该是包括下面这些信息,在msdn中有
uint32 AccessMask;
boolean AllowMaximum;
string Caption;
string Description;
datetime InstallDate;
uint32 MaximumAllowed;
string Name;
string Path;
string Status;
uint32 Type;
Properties
The Win32_Share class defines the following properties.
AccessMask
Data type: uint32
Access type: Read-only
List of access rights to the given file or directory held by the user or group on whose behalf the instance is returned. This property is only supported under Windows NT and Windows 2000. On Windows 98 and on Windows NT/Windows 2000 FAT volumes, the FULL_ACCESS value is returned instead, indicating no security has been set on the object.
Windows 2000, Windows XP: This property is no longer used due to the expense of calling GetEffectiveRightsFromAcl. You should use the Win32_Share.GetAccessMask method instead. The value of the AccessMask property is set to NULL.
AllowMaximum
Data type: boolean
Access type: Read-only
Number of concurrent users for this resource has been limited. If TRUE, the value in the MaximumAllowed property is ignored.
Caption
Data type: string
Access type: Read-only
Short description (one-line string) of the object.
Description
Data type: string
Access type: Read-only
Description of the object.
InstallDate
Data type: datetime
Access type: Read-only
Object was installed. This property does not need a value to indicate that the object is installed.
MaximumAllowed
Data type: uint32
Access type: Read-only
Limit on the maximum number of users allowed to use this resource concurrently. The value is only valid if the AllowMaximum property is set to FALSE
Name
Data type: string
Access type: Read-only
Qualifiers: Key
Alias given to a path set up as a share on a Windows system.
Example: "public"
Path
Data type: string
Access type: Read-only
Local path of the Windows share.
Example: "C:/Program Files"
Status
Data type: string
Access type: Read-only
Current status of the object. Various operational and non-operational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard drive, may be functioning properly but predicting a failure in the near future). Non-operational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither "OK" nor in one of the other states.
Values are:
"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
"Stressed"
"Nonrecover"
"Nocontact"
"LostComm"
Type
Data type: uint32
Access type: Read-only
Type of resource being shared. Types include disk drives, print queues, interprocess communications (IPC), and general devices.
Value Meaning
0 Disk Drive
1 Print Queue
2 Device
3 IPC
2147483648 Disk Drive Admin
2147483649 Print Queue Admin
2147483650 Device Admin
2147483651 IPC Admin -
请教如何获取共享文件和应用程序是由哪个系统帐户创建的
2012-04-10 17:15:591、用NetShareEnum获取到了当前机器上的有共享属性的文件,请问如何获取这个共享文件的共享属性设置时间和设置帐户,即此共享文件是在什么时候由哪个Windows系统帐户设置为共享的? 2、类似第一个问题,利用... -
qt iOS app 如何获取共享文件夹文件,如何使用document文档目录文件
2015-11-28 20:57:58how to get sharing document directory is something different with other qt platforms. IOS app always use files only in app's sandbox. So we just need to find it's sandbox directory. ...how to get sharing document directory is something different with other qt platforms.
IOS app always use files only in app's sandbox. So we just need to find it's sandbox directory.
we may think following would work:
QString docPath;
QDir dir;
docPath=dir.currentPath();
then we use another way:
docPath=QCoreApplication::applicationDirPath();
result is "/private/var/mobile/Containers/Bundle/Application/D31978DF-1A05-4AB9-9C36-18EA2B9E5294/testXXX.app",is that the real sandbox directory? The answer is still no, because we can not show any files sync-in iPhone to testXXX app by iTunes.
(in qt .pro file, we add lines
QMAKE_INFO_PLIST += aaa.plist
in aaa.plist we add "UIFileSharingEnabled true" to enable file sharing with iTunes.)
We have no patience to find other qt traditional way to solve this problem. We use mix IOS obj-c and qt c++ as follows:
QString iOSObj::getDocDir(void)
{
iOSObj::g_iOSObj = this;
//get Documents path
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path=[paths objectAtIndex:0];
NSLog(@"path:%@",path);
QString temp = QString::fromNSString(path);
return temp;
}Finally, the result is
“/var/mobile/Containers/Data/Application/BB26B5E6-3340-4601-A81B-DE5362B1C938/Documents”
-
如何获取,查看Windows和Linux共享文件相关日志
2019-09-01 20:20:15如何获取,查看Windows和Linux共享文件相关日志数据,有什么方法可以拿到这两类数据。 -
qt 访问共享文件夹_qt iOS app 如何获取共享文件夹文件,如何使用document文档目录文件...
2020-12-31 08:04:47how to get sharing document directory is something different with other qt platforms. IOS app always use files only in app's sandbox. So we just need to find it's sandbox directory....how to get sharing document directory is something different with other qt platforms. IOS app always use files only in app's sandbox. So we just need to find it's sandbox directory. we may think following would work: QString docPath;
QDir dir;
docPath=dir.currentPath();
however in qt 5.5 IOS, it return only root directory "/", then we use another way: docPath=QCoreApplication::applicationDirPath(); result is "/private/var/mobile/Containers/Bundle/Application/D31978DF-1A05-4AB9-9C36-18EA2B9E5294/testXXX.app", is that the real sandbox directory? The answer is still no, because we can not show any files sync-in iPhone to testXXX app by iTunes. (in qt .pro file,
we add lines QMAKE_INFO_PLIST += aaa.plist in aaa.plist we add "UIFileSharingEnabled true" to enable file sharing with iTunes.) We have no patience to find other qt traditional way to solve this problem. We use mix IOS obj-c and qt c++ as follows: QString iOSObj::getDocDir(void) {
iOSObj::g_iOSObj = this;
//get Documents path NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path=[paths objectAtIndex:0]; NSLog(@"path:%@",path);
QString temp = QString::fromNSString(path);
return temp; } Finally, the result is “/var/mobile/Containers/Data/Application/BB26B5E6-3340-4601-A81B-DE5362B1C938/Documents”
-
Axure在SVN共享项目如何获取历史文件
2012-01-06 23:01:03可能好用的方法 共享——浏览共享项目历史——获取历史选中之前的签入记录,点击下边的“导出为RP文件” 但我这里的Axure5.6会报错 解决方法 只能用SVN获取历史版本,然后压缩成zip,改名为*.rp再打开即可。...可能好用的方法
共享——浏览共享项目历史——获取历史
选中之前的签入记录,点击下边的“导出为RP文件”但我这里的Axure5.6会报错
解决方法
只能用SVN获取历史版本,然后压缩成zip,改名为*.rp再打开即可。
-
WindowsPhone操作SkyDrive之获取共享文件
2017-11-23 16:29:00本篇主要介绍如何通过获取SkyDrive文件的共享链接,然后将共享链接就行转换,最后在WindowsPhone应用程序中获取SkyDrive文件内容。 基本应用场景: 当进行开发自己WindowsPhone产品时,数据操作是非常重要的,那么... -
Linux如何获取Window7下面的共享文件
2014-11-08 14:22:20先选择共享的内容,比如在下面演示中我选择共享 -
java获取共享目录最新文件下载_从共享链接目录下载和移动OneDrive文件
2021-03-03 10:53:10我正在寻找帮助,以了解如何通过共享链接共享链接方法下载和移动通过共享目录访问的OneDrive文件 .我有两个用户:user 'A'谁是Microsoft Consumer并拥有常规OneDrive帐户,并将在文件夹'toshare'中托管csv文件'test.... -
如何使用PHP脚本从谷歌驱动器共享链接获取文件?
2015-09-13 20:23:54<p>I need to initiate a download of a file stored on google drive thorough a ... </div> -
JAVA如何获取另一台电脑上指定盘的文件?文件未共享,有IP,有用户名密码。
2015-12-14 03:51:02RT,目标终端的IP已知,我也有用户名和密码,然后现在我要在程序里读取目标终端的 E:\test\test.txt 请问要怎么做? 对于这一块的东西一头雾水,求告知~ -
如何在两台电脑之间共享文件
2016-05-10 20:19:13局域网内共享文件 局域网判断:两台电脑通过路由器连接,连上同一个WIFI都算在局域网内。 只要两台电脑用有线或者无线连接到路由器上(包括连上同一wifi),再自动获取IP后,两台电脑就组成。 局域网组成后就... -
如何获取android项目下某个文件的绝对路径
2014-11-29 20:06:31比如要获取 要获取libjnixcld.so绝对路径 ... 简单的说就是/data/data/packagename/你的文件夹名称/文件名 ...非隐藏文件可以这样获取 以上方法只能获取动态共享库的绝对路径 对于像minde.dat,public.d -
获取 文件 默认关联_如何在macOS中管理文件关联?
2021-01-28 00:06:29列表的顶部是macOS的默认应用程序,只要您双击共享相同后缀或扩展名的文件,以及与该文件类型相关联的其他应用程序,然后双击其底部的其他...选项,即可启动macOS 。如果未列出您要使用的应用程序,您可以选择其他... -
在linux环境下 如何 获取 windwos环境的文件
2012-02-17 11:54:19前提 : windwos环境的文件夹已经共享 方法①mount mount -t cifs -o username=xxx //xxx.xxx.xxx.xxx/xxx/xxx/ /home/xxx/xxx/xxx 備考:①Linuxにとって、root権限が必要です。 -
adb修改什么文件获取root权限_chmod修改权限r w x是什么意思,如何修改文件读写权限
2020-11-23 16:37:36对于Mac的用户来说,大多不知道Mac如何修改文件的读写权限,对于文件系统下的文件权限r w x,也不清楚是什么意思,今天就为大家介绍一下Mac文件系统下的chmod修改权限r w x分别是什么意思,Mac如何修改文件的读写... -
从”茄子快传”看应用程序如何获取手机已安装程序的apk文件
2014-06-19 21:49:18”茄子快传”是联想开发的一款近距离文件共享软件,它通过wifi-direct(速度飞快,不需要联网)或者普通的网络(速度慢)在不同手机间传递文件。不知为何,它就火了起来,火的也飞快。其中,共享传输已安装程序文件apk这... -
如何在不越狱的情况下,获取app中的所有常用文件和文件夹
2018-08-09 15:50:11那么想获取其它文件夹就需要把它们拷贝文件目录及文件到Documents目录。下面就是介绍如何把它们拷贝到Documents目录。下科普一下文件夹的知识,linux的思想是一切皆文件,咱们程序猿是一切皆浮云。 iOS中的沙盒机制.... -
如何获取大端中的数据_【软件】ProE中各种获取数据方式的区别
2020-11-12 09:20:52软件ProE中各种获取数据方式的区别输入特征:输入特征是通过数据共享功能从外部文件输入几何的,文件输入以后,会转换成proe软件能够识别的几何,称为一个特征发布几何:发布几何工具可将零件中的几何收集起来,称为... -
sandbox沙盒介绍以及如何取得沙盒里面各文件的路径,图片导入方式和图片路径获取
2016-03-13 17:39:59转:... 其实每个APP的程序都是单独的一个文件夹,每个APP之间相互之间独立,所以它们的文件夹也是独立的,这个文件夹就是沙盒。...坏处,程序之间彼此共享数据较为困难。...(1)如何找 -
如何在vb.net中连接dbf文件并获取数据(高手免进)
2006-05-10 10:56:00最近在写一个需要利用VB.net代码连接dbf文件的程序,有一些体会写下来与新手们共享(我也是个菜鸟)。分析:1、 dbf文件的连接.net的联机文档中没有事例,但可以通过其它的事例来举一反三,例如:"Driver={... -
IOS中获取各种文件的目录路径的方法
2016-02-26 15:14:19其实每个APP的程序都是单独的一个... 坏处,程序之间彼此共享数据较为困难。 1)如何找到应用程序的沙盒源文件? 一般沙盒源文件都存放在~/Library/Application Support/iPhone Simulator/版本号/Applications -
第九章 文件资源共享
2018-11-21 19:59:001、DHCp 的主要用途是什么?...3、当网络中DHCp 客户端是如何获取IP 地址的? 4、当DHCp 服务器报告地址池满时,如何清理租约? 答:管理员可以改变租期的长短。 转载于:https://www.cnblogs.co... -
获取PayPal对账文件故障排查
2007-05-08 15:03:00要成为一名优秀的程序员,不仅要掌握许多程序开发的知识和技巧,更重要的是当遇到问题时如何利用已有的...五一刚过,今早到公司上班,账务组发现PayPal未能获取近一周的对账文件。这东西是以前的开发人员做的,当时只 -
VS修改配置文件共享API(局域网)
2017-08-14 13:06:53第一步:先获取自己所在局域网内的IP地址:ME:192.168.0.129第二步: 修改配置文件,如何获取配置文件的地址,运行VS,屏幕右下角出现的IIS右击,显示正在运行的应用程序,ME:F:\newWorkplace\js.service.business...