c 語言問題 , 希望c 高手教路

2008-06-08 2:02 am
我想問c語言點可以寫一個程式來run file?

比如我有200個files , 我想佢地 random 開, 每隔一陣開一個...

希望c 高手教路!

回答 (2)

2008-06-10 6:41 am
✔ 最佳答案
1. Open webpage with IE:
apply system call, system(char*)
system("\"C:\Program Files\\Internet Explorer\\iexplore.exe\" [url / file]");

e.g.
system("\"C:\Program Files\\Internet Explorer\\iexplore.exe\" hk.yahoo.com");

----------
2. Open webpage randomly:
generate the c string by random function, rand()
using <string> in C++ can be easier to do so.

----------
3. Delay the next call:
using Sleep(int ms) in <windows.h>

e.g.
while(true){
Sleep(rand()*100);
system(...);
}
2008-06-08 2:34 am
Do you want to open the files for reading, or do you want to run (execute) them?

What are the names of the files, do you have a list residing on a disk file, or are they generated according to a known algorithm?

What are the chances that the files are not there?

What are the intervals, fixed, random?

2008-06-08 05:12:35 補充:
Do you want to display the file using a browser such as IE or firefox, or do you want to open the html source file and work with the contents?
Is C a requirement, such as for homework, or any language is OK?


收錄日期: 2021-04-13 15:40:04
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080607000051KK02260

檢視 Wayback Machine 備份