标签:电脑 本地 int err print one ios code read
include <Windows.h> #include <iostream> int main() { HANDLE handle = CreateFile(L"OneNote", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, 0); int err = 0; if (handle == INVALID_HANDLE_VALUE) { err = GetLastError(); } return 0; }
一般连本地的打印机,需要将路径改为 “ \\.\LPT1 ” (LPT1是并行端口名称)
连网络打印,则需要将路径改为 “\\PcName\PrintersName” (PcName是电脑的名称,PrintersName是打印机名称)
如: "\\\\strive-01\\HP880M-BW" (仅供参考)
标签:电脑 本地 int err print one ios code read
原文地址:https://www.cnblogs.com/strive-sun/p/11814019.html