using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Xml;
namespace Apk
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string apkname = "123";
ProcessStartInfo psi = new ProcessStartInfo("cmd.exe");
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.FileName = System.AppDomain.CurrentDomain.BaseDirectory + "apk.bat";
psi.Arguments = apkname;
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);
System.IO.StreamReader sOut = proc.StandardOutput;
proc.Close();
string results = sOut.ReadToEnd().Trim();
sOut.Close();
string filename = System.AppDomain.CurrentDomain.BaseDirectory + apkname + "//AndroidManifest.xml";
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(filename);
string versionName = xmldoc.DocumentElement.Attributes["android:versionName"].Value;
string package = xmldoc.DocumentElement.Attributes["package"].Value;
}
}
}