close

標題:

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

發問:

我想問c語言點可以寫一個程式來run file? 比如我有200個files , 我想佢地 random 開, 每隔一陣開一個... 希望c 高手教路! 更新: I want to open html files for reading! Not really run them, only open them. The names are like index.html , 1.html ,etc. I don't have a list but they are stay in same folder. The file must present. The interval is fixed. 更新 2: I want to display the file using IE. It perfers to use C but it can use others.

最佳解答:

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 in C++ can be easier to do so. ---------- 3. Delay the next call: using Sleep(int ms) in e.g. while(true){ Sleep(rand()*100); system(...); }

其他解答:

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?

免費註冊體驗

 

此文章來自奇摩知識+如有不便請留言告知

arrow
arrow
    創作者介紹
    創作者 kouyssu 的頭像
    kouyssu

    新聞雲

    kouyssu 發表在 痞客邦 留言(0) 人氣()