using System;
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;
            
      

        }
    }

}

 /Files/haolemawo/Apk.zip

 

posted on 2012-09-14 17:56  haolemawo  阅读(551)  评论(1编辑  收藏  举报