コード例 #1
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            string iniFileName = AppDomain.CurrentDomain.BaseDirectory + "UpdateCommon.inf";

            //指定のモジュールを読み込んで、モジュール内の関数を実行
            string cmd = "get_iniFile_sections('" + iniFileName + "')";

            ScriptScope scope = ExecScriptModule("ftpToolUtils", cmd);

            var sec = scope.GetVariable <IList <string> >("result");

            foreach (string m in sec)
            {
                UpdateCommonInfo inf = new UpdateCommonInfo();

                string ver = GetIniValue(iniFileName, string.Format(m), GetName(() => inf.Version));
                _updateVerInfo.Add(new VerInfo {
                    Name = m, Version = ver
                });
                Console.WriteLine(m);
            }
        }
コード例 #2
0
        private void ConnectBtn_Click(object sender, RoutedEventArgs e)
        {
            string iniFileName = AppDomain.CurrentDomain.BaseDirectory + "UpdateCommon_tmp.inf";
            string ip          = ipAddr.Text;

            _ftpCtrl.ConnectFTP(ip, "makihara", "wildgeese");

            string      cmd   = "connect('" + ip + "','" + iniFileName + "')";
            ScriptScope scope = ExecScriptModule("ftpToolUtils", cmd);

            //var ftp = scope.GetVariable<Object>("result");
            var sec = scope.GetVariable <IList <string> >("result");

            foreach (string m in sec)
            {
                UpdateCommonInfo inf = new UpdateCommonInfo();

                string ver = GetIniValue(iniFileName, string.Format(m), GetName(() => inf.Version));
                _curVerInfo.Add(new VerInfo {
                    Name = m, Version = ver
                });
            }
        }