• 大小: 0.06M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-25
  • 语言: C#
  • 标签: C#  文件  共享  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Management;
using System.Windows.Forms;
/*
 * 
 * 作者:牛A与牛C之间
 * Q Q:277922950   C#/Java技术交流群:96020642
 * 微博:http://weibo.com/flydoos
 * 博客:http://flydoos.cnblogs.com
 * 日期:2012-03-15
 * 
 */
namespace GetShareFolder
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void btnStart_Click(object sender EventArgs e)
        {
            // 需要手动添加引用 System.Management
            ManagementobjectSearcher searcher = new ManagementobjectSearcher(“select  *  from  win32_share“);
            foreach (Managementobject share in searcher.Get())
            {
                try
                {
                    string name = share[“Name“].ToString

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-03-15 12:26  GetShareFolder\
     目录           0  2012-03-15 12:29  GetShareFolder\GetShareFolder\
     目录           0  2012-03-15 12:27  GetShareFolder\GetShareFolder\bin\
     目录           0  2012-03-15 12:35  GetShareFolder\GetShareFolder\bin\Debug\
     文件       11264  2012-03-15 12:23  GetShareFolder\GetShareFolder\bin\Debug\GetShareFloder.exe
     文件       24064  2012-03-15 12:23  GetShareFolder\GetShareFolder\bin\Debug\GetShareFloder.pdb
     文件        2403  2012-03-15 12:20  GetShareFolder\GetShareFolder\bin\Debug\GetShareFloder.vshost.exe.manifest
     文件       11776  2012-03-15 12:38  GetShareFolder\GetShareFolder\bin\Debug\GetShareFolder.exe
     文件       24064  2012-03-15 12:38  GetShareFolder\GetShareFolder\bin\Debug\GetShareFolder.pdb
     文件       11600  2012-03-15 12:39  GetShareFolder\GetShareFolder\bin\Debug\GetShareFolder.vshost.exe
     文件        2403  2012-03-15 12:20  GetShareFolder\GetShareFolder\bin\Debug\GetShareFolder.vshost.exe.manifest
     目录           0  2012-03-15 12:27  GetShareFolder\GetShareFolder\bin\Release\
     文件        4110  2012-03-15 12:32  GetShareFolder\GetShareFolder\GetShareFloder.csproj
     文件        1351  2012-03-15 12:38  GetShareFolder\GetShareFolder\MainForm.cs
     文件        4083  2012-03-15 12:38  GetShareFolder\GetShareFolder\MainForm.Designer.cs
     文件        5817  2012-03-15 12:38  GetShareFolder\GetShareFolder\MainForm.resx
     目录           0  2012-03-15 12:04  GetShareFolder\GetShareFolder\obj\
     目录           0  2012-03-15 12:04  GetShareFolder\GetShareFolder\obj\x86\
     目录           0  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\
     文件        4440  2012-03-15 12:34  GetShareFolder\GetShareFolder\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6477  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         322  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\GenerateResource.read.1.tlog
     文件         770  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\GenerateResource.write.1.tlog
     文件        1787  2012-03-15 12:39  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFloder.csproj.FileListAbsolute.txt
     文件         180  2012-03-15 12:21  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFloder.Form1.resources
     文件         180  2012-03-15 12:21  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFloder.Properties.Resources.resources
     文件       11776  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFolder.exe
     文件         180  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFolder.MainForm.resources
     文件       24064  2012-03-15 12:38  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFolder.pdb
     文件         180  2012-03-15 12:35  GetShareFolder\GetShareFolder\obj\x86\Debug\GetShareFolder.Properties.Resources.resources
     目录           0  2012-03-15 12:27  GetShareFolder\GetShareFolder\obj\x86\Debug\TempPE\
............此处省略11个文件信息

评论

共有 条评论