Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从c运行phantomjs_C#_Phantomjs_Screenshot - Fatal编程技术网

C# 从c运行phantomjs

C# 从c运行phantomjs,c#,phantomjs,screenshot,C#,Phantomjs,Screenshot,当我运行代码时,我会弹出命令行窗口,它看起来像是在执行,但我从来没有创建过图像。我正在使用PhantomJS附带的rasterize.js 我有许多网站需要截屏,并将它们存储在列表中 我似乎无法缩小阻止我创建图像的范围。任何帮助都将不胜感激,如果有任何信息丢失或需要澄清,请让我知道 这是我的密码: foreach (var item in itemList) { string outPath = OUTPUTPATH + "\\" + item.foldername;

当我运行代码时,我会弹出命令行窗口,它看起来像是在执行,但我从来没有创建过图像。我正在使用PhantomJS附带的rasterize.js

我有许多网站需要截屏,并将它们存储在列表中

我似乎无法缩小阻止我创建图像的范围。任何帮助都将不胜感激,如果有任何信息丢失或需要澄清,请让我知道

这是我的密码:

foreach (var item in itemList)
    {
        string outPath = OUTPUTPATH  + "\\" + item.foldername;
        System.IO.Directory.CreateDirectory(outPath);

        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = "phantomjs.exe";
        startInfo.WorkingDirectory = @"C:\phantomjs-1.9.7-windows\";
        startInfo.WindowStyle = ProcessWindowStyle.Normal;
        startInfo.CreateNoWindow = true;

        startInfo.Arguments = "/C .\\examples\\rasterize.js " + item.url + " " + outPath + "\\" + item.filename+".jpg;

        using (Process process = Process.Start(startInfo))
        {
            process.WaitForExit();
        }

    }

您可能会看到该解决方案是否有助于调试。