OSRun/MainForm.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace OSRun
{
    /// <summary>
    /// 窗体
    /// </summary>
    public partial class MainForm : Form
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 文件读取
        /// </summary>
        /// <param name="filePath"></param>
        private void RunOpenSEES(string filePath)
        {
            //初始化
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.FileName = "cmd.exe";
            //是否使用操作系统shell启动
            p.StartInfo.UseShellExecute = false;
            //接受来自调用程序的输入信息
            p.StartInfo.RedirectStandardInput = true;
            //由调用程序获取输出信息
            p.StartInfo.RedirectStandardOutput = true;
            //重定向标准错误输出
            p.StartInfo.RedirectStandardError = false;
            //不显示程序窗口
            p.StartInfo.CreateNoWindow = false;
            //启动程序
            p.Start();
            //获得文件夹路径
            string directPath = Path.GetDirectoryName(filePath);
            //获得文件名(包含后缀)
            string fileName = Path.GetFileName(filePath);
            //平移路径
            p.StandardInput.WriteLine(@"cd /d " + directPath);
            //启动运行
            p.StandardInput.WriteLine("opensees " + fileName);
            //等待程序执行完退出进程
            p.WaitForExit();
            p.Close();
        }

后面还有 64 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。