|  | 
 
| JasonDay 初级用户
 
   
 
 
 
 积分 26
 发帖 10
 注册 2006-10-3
 来自 shenzhen
 状态 离线
 | 
| 『楼 主』:
 DOS下可用内存计算的编程
 
使用 LLM 解释/回答一下 
 
 
MS C 编程环境几篇文章看了,试着用memmax memval,
 都不行
 
 不能得到mem 或者 Cs.com出来的正确结果
 我记得原来用dos调用做的
 
 请问有没做过的
 露一手
 
MS C Programming Environment
 After reading several articles, I tried using memmax memval, but none worked.
 
 Can't get the correct result as from mem or Cs.com.
 
 I remember using DOS calls to do it originally.
 
 Asking if anyone has done it, show off.
 
 
 
 |  | 
|  2008-8-8 16:24 |  | 
|  | 
 
| JasonDay 初级用户
 
   
 
 
 
 积分 26
 发帖 10
 注册 2006-10-3
 来自 shenzhen
 状态 离线
 | 
| 『第 2 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
再次请教一下MS C 编程环境下
 如何获取类似
 C:\DOS> MEM /c 中的
 可用常规内存的数据?
 
Once again, I would like to ask. Under the MS C programming environment, how to obtain the data of available conventional memory similar to that in C:\DOS> MEM /c? 
 
 
 |  | 
|  2010-12-17 16:35 |  | 
|  | 
 
| JasonDay 初级用户
 
   
 
 
 
 积分 26
 发帖 10
 注册 2006-10-3
 来自 shenzhen
 状态 离线
 | 
| 『第 3 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
MS C想获得 mem /c > mem1.txt的结果到文件spawnl(_P_WAIT,"c:\\dos\\MEM.exe","mem.exe",NULL);
 可以得到结果
 但是 /C > mem1.txt怎么加到这个函数上面都不行
 运行后出现Invalid Keywork - /C >
 请问应该如何写才能得到mem1.txt
 
To redirect the output of `mem /c` to `mem1.txt` using `spawnl`, you need to use a shell to handle the redirection. You can use `cmd.exe` with the `/c` option to execute the command and redirect the output. Here's how you can modify the code:
 ```c
 spawnl(_P_WAIT, "cmd.exe", "cmd.exe", "/c", "c:\\dos\\MEM.exe mem /c > mem1.txt", NULL);
 ```
 
 This will use the Windows command prompt (`cmd.exe`) to execute the `MEM.exe` command with the `/c` option and redirect the output to `mem1.txt`.
 
 
 
 |  | 
|  2010-12-18 17:01 |  | 
|  | 
 
| zhgwbzhd 高级用户
 
     
 
 
 
 积分 506
 发帖 187
 注册 2005-12-4
 状态 离线
 | 
| 『第 4 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
你查查资料。有一个内存的固定地址,是标注可用内存的。你可以直接读取那里的值,就可以得到可用内存了。
 
You can check the materials. There is a fixed memory address that marks the available memory. You can directly read the value there to get the available memory. 
 
 
 |  | 
|  2011-1-5 10:11 |  | 
|  | 
 
| enjoyer 中级用户
 
    部落守望者
 
 
 积分 351
 发帖 140
 注册 2006-6-19
 状态 离线
 |  | 
|  2011-1-11 09:11 |  |