如何在Wonderware Archestra IDE上使用脚本编制目录中的文件计数

时间:2018-02-15 09:56:24

标签: wonderware

在C:\ tmp_dir中创建了两个文件“test.txt”和“test2.txt”。我想知道“C:\ tmp_dir”中有多少个文件。 我的代码:

    dim s as string;
    s = System.IO.Directory.GetFiles("C:\tmp_dir");
    LogMessage(s.Length);

但这显然是错误的。它返回40(路径中的符号数量和两个文件)而不是2.我怎样才能正确地执行此操作?

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:1)

坦克很多!如你所说" s"必须是整数而不是字符串。用"长度"而不是"计数"工作正常。

var path = require("path");
var webpack = require("webpack");

module.exports = {
  target:'web',

  devServer: {
    contentBase: path.join(__dirname, "build"),
    compress: true,
    port: 9000
  },
  node: {
    fs: 'empty'
  },
  cache: true,
  devtool: "eval", //or cheap-module-eval-source-map
  entry: {
    app: path.join(__dirname, "client/app", "app.js")
  },
  output: {
    path: path.join(__dirname, "buildf"),
    filename: "ha.js",
    chunkFilename: "[name].js"
  },
  plugins: [
    //Typically you'd have plenty of other plugins here as well
    new webpack.DllReferencePlugin({
      context: path.join(__dirname, "client"),
      manifest: require("./build/vendor-manifest.json")
    }),
  ],
  module: {
    loaders: [
      {
        test: /\.js?$/,
        loader: "babel-loader",
        include: [
          path.join(__dirname, "client") //important for performance!
        ],
        exclude: [
          path.resolve(__dirname, "node_modules")
        ],
        query: {
          cacheDirectory: true, //important for performance
          plugins: ["transform-regenerator"],
          presets: ["es2015", "stage-0"]
        }
      },

      { test: /\.(scss|sass)$/, loader: ['style-loader', 'css-loader', 'sass-loader'] },
      { test: /\.html$/, loader: 'raw-loader' },
      { test: /\.css$/, loader: 'css-loader' }
    ]
  }
};