static void Create()
        {
            string PathGPRS = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\AppCenter.exe";
            string PathGPRSTrue = @"/Windows/Desktop/AppCenter.exe.lnk";

 

            if (!File.Exists(PathGPRSTrue))
            {
                //File.Copy(PathGPRS, PathGPRSTrue, true);
                try
                {

                    string text = (PathGPRS.Length + 2).ToString() + "#\"" + PathGPRS + "\"";
                    byte[] buf = new byte[text.Length];
                    buf = System.Text.Encoding.GetEncoding(936).GetBytes(text.Substring(0, text.Length));
                    FileStream fs = new FileStream(PathGPRSTrue, FileMode.CreateNew);
                    fs.Write(buf, 0, buf.Length);
                    fs.Close();
                    fs = null;

                }
                catch (System.Exception ex)
                {

                }
            }

        }

  

posted on 2014-11-28 09:48  倾天  阅读(308)  评论(0编辑  收藏  举报