我需要执行第二个项目的帮助

sajmonekk.

新成员
加入
4月7日,2021年
消息
3
编程经验
Beginner
你好,我需要帮助,我是新的c#可以有人帮助我在没有这种完整方法c:\ users \ sajmo \ source \ repos \ voidsharp \ voidsharp的情况下单击按钮后执行第二个项目控制台应用程序。


截屏: 截屏
 

跳伞运动员

工作人员
加入
2019年4月6日
消息
2,887
地点
切萨皮克,va.
编程经验
10+
请在代码标签中发布相关代码,而不是截图。

无论如何,process.start()可以采用相对路径。您不必将绝对路径传递给其他可执行文件。此外,如果其他可执行文件位于路径搜索中,则询问您需要执行的是可执行名称,而不必指定绝对或相对路径。
 

sajmonekk.

新成员
加入
4月7日,2021年
消息
3
编程经验
Beginner
谢谢你的回应,相对路径吗?怎么做 ?你能帮我吗 ?

Form1.cs:
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 LCUAPI.API.Models;
using System.Net;
using RestSharp;
using LCUAPI.API;
using Newtonsoft.Json;
using ClassicDarkTheme.Dark;
using System.Diagnostics;
using System.Threading;
using System.Windows.Input;
using System.Runtime.InteropServices;

namespace VoidSharp
{
    public partial class Form1 : Form
    {

        SummonerObject.Summoner summoner = new SummonerObject.Summoner();
        Matchmaking.ReadyCheck readyCheck = new Matchmaking.ReadyCheck();
        LolStore.Wallet wallet = new LolStore.Wallet();
        ChampionSummary champSummary = new ChampionSummary();
        SummonerProfile summonerProfile = new SummonerProfile();

        public const int WM_NCLBUTTONDOWN = 0xA1;
        public const int HT_CAPTION = 0x2;

        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern bool ReleaseCapture();

        bool mouseDown;
        private Point offset;
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {
            Environment.Exit(0);
        }

        private void label2_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void label4_MouseDown(object sender, MouseEventArgs e)
        {
            offset.X = e.X;
            offset.Y = e.Y;
            mouseDown = true;
        }

        private void label4_MouseMove(object sender, MouseEventArgs e)
        {
            if (mouseDown == true)
            {
                Point currentScreenPos = PointToScreen(e.Location);
                Location = new Point(currentScreenPos.X - offset.X, currentScreenPos.Y - offset.Y);
            }
        }

        private void label4_MouseUp(object sender, MouseEventArgs e)
        {
            mouseDown = false;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (lblName.Text == "TurboVirgin69")
            {
                lblAdmin.Show();
                lblprem.Hide();
                lblTester.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "TakeLanternOrDie")
            {
                lblprem.Show();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUser.Hide();
                lblUnknown.Hide();
            }
            else if (lblName.Text == "eSuka Ratafack")
            {
                lblprem.Show();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Ozzák Pacovký")
            {
                lblprem.Show();
                lblTester.Hide();
                lblUnknown.Hide();
                lblAdmin.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Oyotlhvw")
            {
                lblTester.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Pornhub Admin")
            {
                lblTester.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "AlexVdits")
            {
                lblTester.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Unknown")
            {
                lblUnknown.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUser.Hide();
            }
            else
            {
                lblUser.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUnknown.Hide();
            }


            Process[] p = Process.GetProcessesByName("LeagueClientUx");
            if (p.Length != 0)
            {
                string showUx = LCU.GetRequest(RestSharp.Method.POST, "/riotclient/ux-show");


                string output = LCU.GetRequest(RestSharp.Method.GET, "/lol-summoner/v1/current-summoner", RestSharp.DataFormat.Json);
                Console.WriteLine(output);
                summoner = JsonConvert.DeserializeObject<SummonerObject.Summoner>(output);
                pbAvatar.ImageLocation = "http://ddragon.leagueoflegends.com/cdn/10.24.1/img/profileicon/" + summoner.ProfileIconId + ".png";
                lblName.Text = summoner.DisplayName;
                lblLevel.Text = Convert.ToString(summoner.SummonerLevel);
                lblLevel2.Text = Convert.ToString(summoner.SummonerLevel);

                //level vyvářenost

                if (Convert.ToInt32(lblLevel.Text) < 100)
                {
                    lblLevel.Show();
                }
                else if (Convert.ToInt32(lblLevel2.Text) > 100)
                {
                    lblLevel2.Show();
                }           
                else
                {

                }

            }

        }
        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Environment.Exit(0);
        }

        private static bool AutoAccept = false;
        private static bool AutoSkinBoost = false;
        private static bool autoSkinDo = false;
        string phase = string.Empty;

        private void LCUTimer_Tick(object sender, EventArgs e)
        {
            Process[] p = Process.GetProcessesByName("LeagueClientUx");
            if (p.Length != 0)
            {
                try
                {
                    string JsonReadyCheck = LCU.GetRequest(RestSharp.Method.GET, "/lol-matchmaking/v1/ready-check");
                    readyCheck = JsonConvert.DeserializeObject<Matchmaking.ReadyCheck>(JsonReadyCheck);
                    if (readyCheck.State == "InProgress" && AutoAccept)
                    {
                        LCU.GetRequest(RestSharp.Method.POST, "/lol-matchmaking/v1/ready-check/accept");
                        //API.LCU.GetRequest(RestSharp.Method.POST, "/lol-matchmaking/v1/ready-check/decline");
                    }

                    string gameflowPhase = LCU.GetRequest(RestSharp.Method.GET, "/lol-gameflow/v1/gameflow-phase");
                    if (phase != gameflowPhase)
                    {
                        phase = gameflowPhase;
                        Console.WriteLine(gameflowPhase);

                        if (phase.Contains("ChampSelect") && AutoSkinBoost && !autoSkinDo)
                        {
                            Sleep(1000);
                            autoSkinDo = true;
                            var skinboost = LCUAPI.API.LCU.GetRequest(Method.POST, "lol-champ-select/v1/team-boost/purchase");
                            Console.WriteLine(skinboost);
                            TeamBoost myDeserializedClass = JsonConvert.DeserializeObject<TeamBoost>(skinboost);
                        }
                        else if (!phase.Contains("ChampSelect"))
                        {
                            autoSkinDo = false;
                        }
                    }
                }
                catch { }
            }
        }

        private void AutoUpdate_Tick(object sender, EventArgs e)
        {

            if (lblName.Text == "TurboVirgin69")
            {
                lblAdmin.Show();
                lblprem.Hide();
                lblTester.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "TakeLanternOrDie")
            {
                lblprem.Show();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUser.Hide();
                lblUnknown.Hide();
            }
            else if (lblName.Text == "eSuka Ratafack")
            {
                lblprem.Show();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Ozzák Pacovký")
            {
                lblprem.Show();
                lblTester.Hide();
                lblUnknown.Hide();
                lblAdmin.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Oyotlhvw")
            {
                lblTester.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Pornhub Admin")
            {
                lblTester.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "AlexVdits")
            {
                lblTester.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblUnknown.Hide();
                lblUser.Hide();
            }
            else if (lblName.Text == "Unknown")
            {
                lblUnknown.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUser.Hide();
            }
            else
            {
                lblUser.Show();
                lblprem.Hide();
                lblAdmin.Hide();
                lblTester.Hide();
                lblUnknown.Hide();
            }

            Process[] p = Process.GetProcessesByName("LeagueClientUx");
            if (p.Length != 0)
            {
                string output = LCU.GetRequest(RestSharp.Method.GET, "/lol-summoner/v1/current-summoner", RestSharp.DataFormat.Json);
                Console.WriteLine(output);
                summoner = JsonConvert.DeserializeObject<SummonerObject.Summoner>(output);
                pbAvatar.ImageLocation = "http://ddragon.leagueoflegends.com/cdn/10.24.1/img/profileicon/" + summoner.ProfileIconId + ".png";
                lblName.Text = summoner.DisplayName;
                lblLevel.Text = Convert.ToString(summoner.SummonerLevel);
                lblLevel2.Text = Convert.ToString(summoner.SummonerLevel);
                if (Convert.ToInt32(lblLevel.Text) < 100)
                {
                    lblLevel.Show();
                }
                else if (Convert.ToInt32(lblLevel2.Text) > 100)
                {
                    lblLevel2.Show();
                }
                else
                {

                }
            }
            else
            {
                
            }
        }
        public static async void Sleep(double msec)
        {
            for (var since = DateTime.Now; (DateTime.Now - since).TotalMilliseconds < msec;)
                await Task.Delay(TimeSpan.FromTicks(10));
        }

        private void cbAutoAccept_CheckedChanged(object sender, EventArgs e)
        {
            AutoAccept = cbAutoAccept.Checked;
        }

        private void btnAramSkinBoost_Click(object sender, EventArgs e)
        {
            Process.Start("");
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            
        }

        private void label6_Click(object sender, EventArgs e)
        {
            Info a = new Info();
            a.Show();
        }

        private void darkButton1_Click(object sender, EventArgs e)
        {
            if (EnablePremium.Checked)
            {
                Accounts d = new Accounts();
                d.Show();
            }
        }

        private void label7_Click(object sender, EventArgs e)
        {
            Voidinfo b = new Voidinfo();
            b.Show();
        }

        private void EnablePremium_CheckedChanged(object sender, EventArgs e)
        {
            if (lblAdmin.Visible == true)
            {

            }
            else if (lblprem.Visible == true)
            {

            }
            else if (lblTester.Visible == true)
            {

            }
            else
            {
                EnablePremium.Checked = false;
                messagebox c = new messagebox();
                c.Show();
            }
        }
    }
}
 

跳伞运动员

工作人员
加入
2019年4月6日
消息
2,887
地点
切萨皮克,va.
编程经验
10+
如果您知道如何执行P / Invoke调用,请在上面的代码中查找运行进程,则存在一些严重的断开连接,但您甚至不知道相对路径是什么。
 
最佳 底部