照着书敲的.留作笔记吧. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace _18获取本机磁盘信息 { class Program { static void Main(string[] args) { GetDiskInfo(); Console.ReadKey(); } [Dl
众所周知,在微软的操作系统下编写应用程序,最主要的还是通过windows所提供的api函数来实现各种操作的,这些函数通常是可以直接使用的,只要包含windows.h这个头文件, 下载源文件 今天我们主要介绍的是几个常用的api函数,通过它我们可以获取用户磁盘的相关信息. 其主要函数原型说明如下: 1.获取系统中逻辑驱动器的数量 The GetLogicalDrives function retrieves a bitmask representing the currently availabl
众所周知,在微软的操作系统下编写应用程序,最主要的还是通过windows所提供的api函数来实现各种操作的,这些函数通常是可以直接使用的,只要包含windows.h这个头文件. 今天我们主要介绍的是几个常用的api函数,通过它我们可以获取用户磁盘的相关信息. 示例程序:请点击附件下载. 其主要函数原型说明如下: 1.获取系统中逻辑驱动器的数量 The GetLogicalDrives function retrieves a bitmask representing the currentl
内存信息 / meminfo 返回dict #!/usr/bin/env python def memory_stat(): mem = {} f = open("/proc/meminfo") lines = f.readlines() f.close() for line in lines: if len(line) < 2: continue name = line.split(':')[0] var = line.split(':'
脚本内容: <# .SYNOPSIS This script grab all ARM VM VHD file in the subscription and caculate VHD size. .DESCRIPTION This script grab all ARM VM VHD file in the subscription and caculate VHD size. .Example .\Get-ArmVMDiskSize.ps1 -subscriptionid xxxxxxx-x
1.获取数据库中的表 select name from sysobjects where type='U' 2.获取表字段(此处是Route表) Select name from syscolumns Where ID=OBJECT_ID('Route') 3.获取表中字段的描述 SELECT value FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'Route', 'column', default) 4.获取表的