摘要:该程序用于获取系统的路由信息,,,在删除某条路由记录时,本想通过DeleteIpForwardEntry函数实现,发现需要指定dwForwardPolicy,该字段不是很清楚,因此通过遍历路由表,然后匹配要删除的路由表的目的、网关IP来实现 。#include <Windows.h>#include <stdio.h>#include <IPHlpApi.h>#include "conio.h"#pragma comment(lib, "iphlpapi.lib")#pragma comment(lib, "
阅读全文
摘要:#include <shlobj.h> HRESULT GetLinkFilePath(HWND hWnd, LPWSTR lpwsLinkName, LPWSTR lpwsLinkPath) { CoInitialize(NULL); IShellLink *pIShellLink = NULL; HRESULT hResult = CoCreateInstance((REFIID)CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, (REFIID)IID_IShellLink,(LPVOID *)&pIShellLink); if
阅读全文
摘要:// Use to convert bytes to KB#define DIV 1024// Specify the width of the field in which to print the numbers.// The asterisk in the format specifier "%*I64d" takes an integer// argument and uses it to pad and right justify the number.#define WIDTH 7////memory information///MEMORYSTATUSEX s
阅读全文