<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>曲径通幽论坛 - Examples</title>
    <link>http://www.groad.net/bbs/forum.php?mod=forumdisplay&amp;fid=112</link>
    <description>Latest 20 threads of Examples</description>
    <copyright>Copyright(C) 曲径通幽论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Tue, 26 May 2026 16:05:30 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.groad.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>曲径通幽论坛</title>
      <link>http://www.groad.net/bbs/</link>
    </image>
    <item>
      <title>USB 磁盘写保护</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7741</link>
      <description><![CDATA[可以通过修改注册表来打开 U 盘的写保护功能。比如在 XP 下面，当你复制一个文件到 USB 磁盘上时，会看到类似下面的错误提示：

若是在 VISTA 或 WIN7 下同样会看到：


实际上是修改了 HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\StorageDevicePolicies 下 ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Thu, 18 Apr 2013 15:54:44 +0000</pubDate>
    </item>
    <item>
      <title>通过映射文件共享数据</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6219</link>
      <description><![CDATA[通过映射文件共享数据是进程间通讯的常用方法之一。因为 Mapping 对象在系统中是全局的，一个进程创建的映射对象可以从另一个进程中打开，此时映射视图就是进程间的共享内存。

下面有 2 个程序，程序一创建一个 Mapping 对象，并在对象的视图中写入需要共享的数据，然 ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Tue, 21 Feb 2012 08:16:29 +0000</pubDate>
    </item>
    <item>
      <title>递归遍历目录</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6172</link>
      <description><![CDATA[下面程序使用递归遍历目录树：

[mw_shl_code=cpp,true]
#include \&quot;stdafx.h\&quot;

DWORD TraverDir (LPTSTR szPath)
{
    setlocale(LC_ALL, \&quot;chs\&quot;);

    WIN32_FIND_DATA FindFileData;
    HANDLE hListFile;

    TCHAR szFilePath[MAX_PATH];
    TCHAR szFullPath[M ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Thu, 16 Feb 2012 07:57:06 +0000</pubDate>
    </item>
    <item>
      <title>判断光驱中是否有光盘</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6147</link>
      <description><![CDATA[可主要通过 GetDriveType()  和 GetVolumeInformation() 这两个函数来判断光驱中是否有光盘。

可以先用驱动器根路径作为 GetDriveType() 的参数，如果返回值为 DRIVE_CDROM ，那么说明指定的驱动器为光驱。然后使用 GetVolumeInformation() 来获取卷信息，若函数执行成 ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Tue, 14 Feb 2012 03:54:17 +0000</pubDate>
    </item>
    <item>
      <title>RecordAccess 注释</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=4721</link>
      <description><![CDATA[RecordAccess 来自 WSP4 ，它维护了一个记录尺寸固定的文件，该文件分为两个部分：文件头和文件内容。其中文件头包含了文件中的非空记录数以及文件记录容量，它用下面的结构表示：
[mw_shl_code=cpp,true]
 struct _HEADER { 
    DWORD            numRecords;         ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Wed, 14 Sep 2011 16:22:02 +0000</pubDate>
    </item>
    <item>
      <title>产生固定长度记录工具</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=4693</link>
      <description><![CDATA[以下代码可以生成固定长度记录文本，程序本身用处不大。产生文本的效果如下：

在命令行中科指定产生上面格式记录的条数，以及生成的文件名。

代码：
[mw_shl_code=cpp,true]
#include \&quot;stdafx.h\&quot;
#define CR 0x0D
#define LF 0x0A

static VOID srandx (DWORD);    
s ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Sun, 11 Sep 2011 03:51:52 +0000</pubDate>
    </item>
    <item>
      <title>凯撒加密算法</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=4682</link>
      <description><![CDATA[使用 C 库实现的代码：

使用 Windows API 读写文件版本：
[mw_shl_code=cpp,true]
#include \&quot;stdafx.h\&quot;

#define BUF_SIZE 256

BOOL cci_f (LPCTSTR, LPCTSTR, DWORD);

VOID ReportError (LPCTSTR userMessage, DWORD exitCode, BOOL printErrorMessage)
{
    DWORD ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Sat, 10 Sep 2011 09:29:11 +0000</pubDate>
    </item>
    <item>
      <title>简单模拟 getopt() 的 Options()</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=4668</link>
      <description><![CDATA[使用 Options() 函数实现对 getopt() 函数的简单模拟，该函数接收形如 \'-c\' (一个破折号加一单字符)的命令行选项。该函数原型为：


下面分析该函数的代码和使用方法举例(Codes Come From WSP4)

代码如下：
[mw_shl_code=cpp,true]
#include 
#include 
DWORD Options  ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Fri, 09 Sep 2011 19:41:32 +0000</pubDate>
    </item>
    <item>
      <title>操作控制台示例</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=4657</link>
      <description><![CDATA[下面代码主要涉及 3 个控制台操作函数：setConsoleMode()，    ReadConsole() 和 WriteConsole() 。

[mw_shl_code=cpp,true]
#include \&quot;stdafx.h\&quot;

/* 处理错误信息，将错误信息格式化为系统的默认语言输出 */
VOID ReportError (LPCTSTR userMessage, DWORD exitCode, ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Fri, 09 Sep 2011 06:35:29 +0000</pubDate>
    </item>
    <item>
      <title>Windows 文件复制程序</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=3722</link>
      <description><![CDATA[该复制程序用法：cp file1 file2
将 file1 的内容复制到 file2 中。程序中使用了 Windows API 。在 VS 2010 中编译通过；为了避免编译错误或警告，需要先将 #include  头文件放在 stdafx.h 中。
代码：
[mw_shl_code=cpp,true]#include \&quot;stdafx.h\&quot;

#define BUF_SIZE 25 ...]]></description>
      <category>Examples</category>
      <author>beyes</author>
      <pubDate>Wed, 08 Jun 2011 08:34:02 +0000</pubDate>
    </item>
  </channel>
</rss>