我没分了
但 DOS 下可以

解决方案 »

  1.   

    WinExec(LPCSTR("net time \\192.168.0.18",SW_SHOW)
    还有,执行完后会自动关闭,当然没结果
      

  2.   

    hostname="192.168.0.18";
    aaa=WinExec((LPCSTR)("nettime\\"+hostname+">c:\time.txt"),SW_SHOW);请问这样可以吗?
      

  3.   

    后面,不能把时间写到time.txt
    为什么?
      

  4.   


    WinExec(LPCSTR("net time \\ 127.0.0.1 >>001.txt"),SW_SHOW);VC 不能用 + 连接字符串,要是想连接用 STRCPY 或者strcat
      

  5.   

    char s[100]="net time \\192.168.0.18";
    WinExec(strcat(s,">>001.txt"),SW_SHOW)