c++ - 如何使用 C++ 打开 excel 查看器文件?

标签 c++

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <fstream>

main(){

    int i, k=0;
    //while(1){

    char prova[9]="20:00:00";
    char timeStr [9];
    _strtime( timeStr );
    //printf( "The current time is %s \n", timeStr);

    for(i=0;i<9;i++){
    if(prova[i]!=timeStr[i])
        k=1;
    }

   if(k=1){

    system("C:\>tskill xlview");
    system("C:\>start "" Programas\\Microsoft Office\\Office12\\xlview.exe" "c:\teste.xls");
   }
   //main();
}

/我打算制作一个程序,每天在特定时间关闭然后打开 excel 查看器文件。我知道如何执行 shell 命令,但我使用的路径不起作用/

最佳答案

不要使用“C:>start”,而是使用“start”或程序文件的完整路径。 “C:>”是命令提示符。

关于c++ - 如何使用 C++ 打开 excel 查看器文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32400329/

相关文章:

c++ - 并行 Fsharp 与并行 C++

c++ - 我可以直接在我的对象上调用重载的括号吗?

c++ - 从 .tsv 文件中读入

c++ - 我们可以将整数值分配给引用变量吗?

c++ - 确定网络连接链接速度

c++ - 在 "/="部分使用运算符 'declare&initialize'

c++ - boost::filesystem::path::native() 返回 std::basic_string<wchar_t> 而不是 std::basic_string<char>

c++ - 使用 rand() 函数生成 ascii 值

C++ std::map,键的旋转

c++ - 避免使用模板函数的 if-else 语句