【问题标题】:How could i implement automatic YT opening? [closed]我如何实现自动 YT 打开? [关闭]
【发布时间】:2018-12-02 11:33:03
【问题描述】:

基本上是标题。

如何实现打开浏览器,然后打开 youtube 和特定音乐。

Ty 提前。

【问题讨论】:

标签: c++ youtube


【解决方案1】:

在 Windows 上,这应该可以打开您的默认浏览器:

ShellExecute(
    NULL,                   // handle to parent window
    "open",                 // pointer to string that specifies operation to perform
    "http://youtube.com/",  // pointer to filename, folder name or resource
    NULL,                   // pointer to string that specifies executable-file parameters
    ".",                    // pointer to string that specifies default directory
    SW_SHOWNORMAL           // whether file is shown when opened
);

【讨论】:

  • 完美运行!
  • 太棒了!不客气!
【解决方案2】:

使用系统();要运行任何 bash 命令,请使用:

system("Browserpath http://youtube.com/");

显然,将 Browserpath 替换为浏览器的路径。

【讨论】:

  • 它不起作用,它说:'Browsepath' 不是内部或外部命令、可运行程序或批处理文件。
  • 您错过了最后一句话:将 Browserpath 替换为您的浏览器路径。顺便说一句,您使用的是什么操作系统?
  • 哦,我的错。好的。我正在使用 Win 8.1
【解决方案3】:

您可以使用system() 函数: system("start https://www.youtube.com"); 如果您使用“开始”命令,Windows 将打开您的默认浏览器,如果您想使用其他浏览器打开,则必须将 start 替换为您的浏览器路径。

【讨论】:

  • 这比我的回答好。不知道。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-03-28
  • 2012-12-02
  • 2019-05-16
  • 1970-01-01
  • 1970-01-01
  • 2014-02-05
  • 1970-01-01
相关资源
最近更新 更多