有没有办法(或API)知道文本文件的编辑时间(由程序或个人编辑)并执行特定操作?
例如:我想在编辑文件c:\ Users\john\free.txt时显示MessageBox.
这个结构我得到一个错误:
dp = opendir ("%APPDATA%/.");
output:
Couldn't open directory: Mo such file or directory.
Run Code Online (Sandbox Code Playgroud)
但我没有得到这个错误的错误:
dp = opendir ("C:/Users/xrobot/AppData/.");
output:
.
..
Local
LocalLow
Roaming
Run Code Online (Sandbox Code Playgroud)
为什么?
这是我简单程序的一部分
string appData = getenv("APPDATA");
const char *mypath= (appData+"\\MyApplication\\hello.txt").c_str();
cout << mypath;
// output: c:\users\xrobot\appdata\Roaming\Myapplication\hello.txt
fstream file(mypath,ios::in);
ofstream filetemp;
filetemp.open("world.bak");
cout << mypath;
// output: É?7
Run Code Online (Sandbox Code Playgroud)
为什么mypath在那个奇怪的字符串中改变了?
例如,我想知道这些文件是否存在.
http://www.stackoverflow.com/favicon.ico
http://www.stackoverflow.com/reset.css
Run Code Online (Sandbox Code Playgroud)
然后下载它(如果显然是exixts).
我创建了一个简单的博客站点与facebook连接,以了解朋友何时访问博客.
要知道这一点,我必须保存facebook朋友的每个id,有时一个人最多有5000个朋友,这意味着5000 INSERT查询(非常慢).
您建议我使用什么解决方案来避免5000 INSERT查询?
也许我可以立即将所有ID保存在mysql文本字段中?
当我点击"+ 1"时,然后在"0"中出现"NaN".为什么?
HTML:
<table>
<tr><td id="run">0</td></tr>
</table>
<a href="#" onclick="plus();">+ 1 </a>
Run Code Online (Sandbox Code Playgroud)
JS:
function plus(){
document.getElementById("run").innerHTML = ( document.getElementById("run").value + 1 );
}
Run Code Online (Sandbox Code Playgroud) 这是我的代码:
$blogid = mysql_real_escape_string($_GET['id']);
if((isset($_POST['comment']))&&(!(trim($_POST['comment'])==FALSE))&&(isset($_SESSION['userid']))){
$comment = mysql_real_escape_string($_POST['comment']);
$querycomment = "INSERT INTO `comment` (`userid`, `blogid`, `body`) VALUES ( '".$_SESSION['userid']."', '".$blogid."', '".$comment."');";
$rowchat = mysql_query($querymess,$db_con) or die("Failed: " . mysql_error() );
}
<form method="post" action="blog.php?id=<?php echo $blogid; ?>" >
<textarea name="comment" ></textarea>
<input type="submit" value="send" name="submit" />
</form>
Run Code Online (Sandbox Code Playgroud)
当用户对此发表评论时:
This
is
my
world
Run Code Online (Sandbox Code Playgroud)
然后在评论列表中显示:
This is my world
Run Code Online (Sandbox Code Playgroud)
为什么断线不起作用?
有没有办法通过C++或C将google.com这样的网站设置为主页?怎么样 ?
为什么这不匹配?
...
puts (ep->d_name);
if(ep->d_name=="testme"){ printf("ok"); } else { printf("no"); }
...
Run Code Online (Sandbox Code Playgroud)
输出:
testme
no
Run Code Online (Sandbox Code Playgroud)