Ejemplo n.º 1
0
        public DialogDetails(SoftInfo softInfo)
        {
            InitializeComponent();

            _softInfo = softInfo;
            Title     = softInfo.Name;
        }
Ejemplo n.º 2
0
        protected override void OnStart(string[] args)
        {
            //ConfigInfo info = new ConfigInfo();
            //var path = "F:\\设备管理\\DeviceMonitor\\SubServiceForDeviceMonitor\\bin\\Debug\\soft.ini";//info.GetCurrentPath();
            //var io = info.GetConfigInfo(path);
            //softinfo= info.SerialObj(io);

            PacketInfo       pinfo = new PacketInfo();
            LANAllComputerIp lan   = new LANAllComputerIp();

            lan.GetLocalMachineIp();
            lan.localMachine.status = LANAllComputerIp.ComputerStatus.ON_LINE;
            pinfo.ip.Add(lan.localMachine);
            SoftInfo sinfo = new SoftInfo();

            sinfo.SoftName = "coach.exe";
            sinfo.status   = SoftStatus.Init;
            pinfo.soft.Add(sinfo);
            Packet pt   = new Packet();
            var    data = pt.Package(pinfo);

            sc.Start();
            sc.RD += Sc_RD;
            sc.SendInfo("", data);
        }
Ejemplo n.º 3
0
 public static IList <SoftInfo> XmlToSoftList(string xml)
 {
     if (xml == "")
     {
         return(null);
     }
     try
     {
         XmlDocument document = new XmlDocument();
         document.LoadXml(xml);
         XmlElement       documentElement = document.DocumentElement;
         IList <SoftInfo> list2           = new List <SoftInfo>();
         foreach (XmlNode node in documentElement.ChildNodes)
         {
             SoftInfo item  = new SoftInfo();
             XmlNode  node2 = node.SelectSingleNode("SoftId");
             item.SoftId   = int.Parse(node2.InnerText);
             node2         = node.SelectSingleNode("SoftName");
             item.SoftName = node2.InnerText;
             node2         = node.SelectSingleNode("SoftDesc");
             item.SoftDesc = node2.InnerText;
             list2.Add(item);
         }
         return(list2);
     }
     catch (Exception exception)
     {
         ilog_0.Info("XmlToSoftList" + exception.Message);
         return(null);
     }
 }
Ejemplo n.º 4
0
        /// <summary>从门户后台管理自动登录</summary>
        private bool AutoLogin(string returnUrl)
        {
            var token = this.Request.QueryString["token"];

            if (token.IsNullOrEmpty())
            {
                return(false);
            }
            var userId = this.Context.GetPortalMgmtUserId(token);

            if (userId.IsNullOrEmpty())
            {
                return(false);
            }
            var nUserId = 0;

            if (!int.TryParse(userId, out nUserId))
            {
                return(false);
            }
            var user = this.Context.GetPortalMgmtUser(nUserId);

            if (user == null)
            {
                return(false);
            }
            var admin   = Users.GetUserInfo(user.USERNAME);
            var context = this.Context.GetHttpContextWrapper();
            var config  = GeneralConfigs.GetConfig();

            if (admin == null)
            {
                var principal = new PKSPrincipal();
                var identity  = new PKSIdentity();
                identity.Name        = user.USERNAME;
                identity.Email       = user.EMAIL;
                identity.PhoneNumber = user.PHONENUMBER;
                principal.Identity   = identity;
                admin = context.CreateUser(config, principal, true);
            }
            else if (admin.Adminid != 1 || admin.Groupid != 1)
            {
                admin.Adminid  = 1;
                admin.Groupid  = 1;
                admin.Authtime = Utils.GetDateTime();
                AdminUsers.UpdateUserAllInfo(admin);
                //移除该用户的在线信息,使之重建在线表信息
                OnlineUsers.DeleteUserByUid(admin.Uid);
            }
            var adminGroup = AdminUserGroups.AdminGetUserGroupInfo(admin.Groupid);

            ForumUtils.WriteUserCookie(admin.Uid, ForumExtension.ExpireMinutes, config.Passwordkey);
            this.Context.AddAdminCookie(config, admin.Uid, admin.Password, admin.Secques, ForumExtension.ExpireMinutes);
            SoftInfo.LoadSoftInfo();
            AdminVistLogs.InsertLog(admin.Uid, admin.Username, admin.Groupid, adminGroup.Grouptitle, DNTRequest.GetIP(), "后台管理员登陆", "");
            return(true);
        }
Ejemplo n.º 5
0
        private void button2_Click(object sender, EventArgs e)
        {
            SoftInfo tmp = (SoftInfo)SerializeHelper.DeserializeFromXml(typeof(SoftInfo), this.textBox1.Text.Trim());

            MessageBox.Show(tmp.Plugins.Count.ToString());
            PluginInfo tmp2 = tmp.Plugins[1] as PluginInfo;

            MessageBox.Show(tmp2.Text);
        }
Ejemplo n.º 6
0
 private void ButtonDone_Click(object sender, RoutedEventArgs e)
 {
     SoftInfo = new SoftInfo
     {
         Name           = TextBoxName.Text,
         Path           = TextBoxPath.Text,
         LastUpdateDate = DateTime.Now
     };
     Close();
 }
Ejemplo n.º 7
0
        private void ViewSoftInfo(SoftInfo softInfo)
        {
            var itemDetails = new MenuItem
            {
                Header = "Details"
            };

            itemDetails.Click += (sender, args) =>
            {
                new DialogDetails(softInfo).ShowDialog();
            };

            ListBoxSoft.Items.Add(new CheckBox
            {
                Content     = softInfo,
                ContextMenu = new ContextMenu
                {
                    ItemsSource = new[] { itemDetails }
                },
                Width = ListBoxSoft.Width
            });
        }
Ejemplo n.º 8
0
        public void VerifyLoginInf()
        {
            if (!Discuz.Forum.OnlineUsers.CheckUserVerifyCode(olid, DNTRequest.GetString("vcode")))
            {
                Response.Redirect("syslogin.aspx?result=3");
                return;
            }

            UserInfo userInfo = null;

            if (config.Passwordmode == 1)
            {
                userInfo = Users.GetUserInfo(Users.CheckDvBbsPassword(DNTRequest.GetString("username"), DNTRequest.GetString("password")));
            }
            else if (config.Passwordmode == 0)
            {
                userInfo = Users.GetUserInfo(Users.CheckPassword(DNTRequest.GetString("username"), Utils.MD5(DNTRequest.GetString("password")), false));
            }
            else//第三方加密验证模式
            {
                userInfo = Users.CheckThirdPartPassword(DNTRequest.GetString("username"), DNTRequest.GetString("password"), -1, null);
            }

            if (userInfo != null)
            {
                UserGroupInfo usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(userInfo.Groupid);

                if (usergroupinfo.Radminid == 1)
                {
                    ForumUtils.WriteUserCookie(userInfo.Uid, 1440, GeneralConfigs.GetConfig().Passwordkey);

                    //UserGroupInfo userGroupInfo = AdminUserGroups.AdminGetUserGroupInfo(userInfo.Groupid);

                    HttpCookie cookie = new HttpCookie("dntadmin");
                    cookie.Values["key"] = ForumUtils.SetCookiePassword(userInfo.Password + userInfo.Secques + userInfo.Uid, config.Passwordkey);
                    cookie.Expires       = DateTime.Now.AddMinutes(30);
                    HttpContext.Current.Response.AppendCookie(cookie);

                    AdminVistLogs.InsertLog(userInfo.Uid, userInfo.Username, userInfo.Groupid, usergroupinfo.Grouptitle, DNTRequest.GetIP(), "后台管理员登陆", "");

                    try
                    {
                        SoftInfo.LoadSoftInfo();
                    }
                    catch
                    {
                        Response.Write("<script type=\"text/javascript\">top.location.href='index.aspx';</script>");
                        Response.End();
                    }

                    //升级general.config文件
                    try
                    {
                        GeneralConfigs.Serialiaze(GeneralConfigs.GetConfig(), Server.MapPath("../config/general.config"));
                    }
                    catch { }

                    Response.Write("<script type=\"text/javascript\">top.location.href='index.aspx';</script>");
                    Response.End();
                }
                else
                {
                    Response.Redirect("syslogin.aspx?result=2");
                }
            }
            else
            {
                Response.Redirect("syslogin.aspx?result=1");
            }
        }
Ejemplo n.º 9
0
 private void AddSoftInfo(SoftInfo softInfo)
 {
     _storage.Add(softInfo);
     ViewSoftInfo(softInfo);
 }
Ejemplo n.º 10
0
        public void VerifyLoginInf()
        {
            if (!OnlineUsers.CheckUserVerifyCode(olid, DNTRequest.GetString("vcode")))
            {
                Response.Redirect("syslogin.aspx?result=3");
                return;
            }

            DataTable dt = new DataTable();

            if (config.Passwordmode == 1)
            {
                int uid = Discuz.Forum.Users.CheckDvBbsPassword(DNTRequest.GetString("username"), DNTRequest.GetString("password"));

                dt = DatabaseProvider.GetInstance().GetUserInfo(uid);
            }
            else
            {
                dt = DatabaseProvider.GetInstance().GetUserInfo(UserName.Text.Trim(), Utils.MD5(PassWord.Text.Trim()));
            }


            if (dt.Rows.Count > 0)
            {
                UserGroupInfo usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(Convert.ToInt32(dt.Rows[0]["groupid"].ToString()));

                if (usergroupinfo.Radminid == 1)
                {
                    ForumUtils.WriteUserCookie(Convert.ToInt32(dt.Rows[0]["uid"].ToString().Trim()), 1440, GeneralConfigs.GetConfig().Passwordkey);

                    int    userid      = Convert.ToInt32(dt.Rows[0]["uid"].ToString().Trim());
                    string username    = UserName.Text.Trim();
                    int    usergroupid = Convert.ToInt16(dt.Rows[0]["groupid"].ToString().Trim());
                    string secques     = dt.Rows[0]["secques"].ToString().Trim();
                    string ip          = DNTRequest.GetIP();

                    UserGroupInfo __usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(usergroupid);

                    string grouptitle = __usergroupinfo.Grouptitle;


                    HttpCookie cookie = new HttpCookie("dntadmin");
                    cookie.Values["key"] = ForumUtils.SetCookiePassword(Utils.MD5(PassWord.Text.Trim()) + secques + userid.ToString(), config.Passwordkey);
                    cookie.Expires       = DateTime.Now.AddMinutes(30);
                    HttpContext.Current.Response.AppendCookie(cookie);

                    AdminVistLogs.InsertLog(userid, username, usergroupid, grouptitle, ip, "后台管理员登陆", "");

                    try
                    {
                        SoftInfo.LoadSoftInfo();
                    }
                    catch
                    {
                        Response.Write("<script type=\"text/javascript\">top.location.href='index.aspx';</script>");
                        Response.End();
                    }

                    //升级general.config文件
                    try
                    {
                        GeneralConfigs.Serialiaze(GeneralConfigs.GetConfig(), Server.MapPath("../config/general.config"));
                    }
                    catch { }


                    Response.Write("<script type=\"text/javascript\">top.location.href='index.aspx';</script>");
                    Response.End();
                    return;
                }
                else
                {
                    Response.Redirect("syslogin.aspx?result=2");
                    return;
                }
            }
            else
            {
                Response.Redirect("syslogin.aspx?result=1");
                return;
            }
        }
Ejemplo n.º 11
0
        /* public SoftInfo soft=new SoftInfo();

        private void InitSoftInfo()
        {
            soft.ChangeLogPath = "c:\\changelog.log";
            soft.Company = "fm-company";
            soft.Developer = "austin chen";
            soft.Email = "*****@*****.**";
            soft.IsDeploy = true;
            soft.IsGlobalization = true;
            soft.MainVersion = "1.0.0.1";
            soft.Name = "��УԤ¼��ϵͳ";
            soft.Tel = "15912345678";
            soft.Url = "http://www.hutong.com";
            RegInfo reginfo=new RegInfo();
            reginfo.BeginDate=new DateTime(2007,12,12);
            reginfo.LastDate=new DateTime(2008,1,1);
            reginfo.MachineCode="machinecode";
            reginfo.RegCode="regcode";
            reginfo.UserName="******";
            reginfo.UseTimes=100;
            soft.RegInfo = reginfo;
            PluginInfo plugin1 = new PluginInfo();
            plugin1.CategoryIndex = 1;
            plugin1.ChangeLogPath = "plugin1.changelog.log";
            plugin1.Company = "plugin1company";
            plugin1.Developer = "develper1";
            plugin1.Email = "email";
           // plugin1.Img = null;
            plugin1.IsDeploy = false;
            plugin1.IsGlobalization = false;
            plugin1.MainVersion="2.0.0.5";
            plugin1.Method = "method";
            plugin1.Name = "plugin1";
            plugin1.Text = "�����";
            plugin1.Url = "pluginurl";
            plugin1.Tel = "tel";
            soft.Plugins.Add(plugin1);

            PluginInfo plugin2 = new PluginInfo();
            plugin2.CategoryIndex = 2;
            plugin2.ChangeLogPath = "plugin2.changelog.log";
            plugin2.Company = "plugin2company";
            plugin2.Developer = "develper2";
            plugin2.Email = "email";
            //plugin2.Img = null;
            plugin2.IsDeploy = false;
            plugin2.IsGlobalization = false;
            plugin2.MainVersion = "2.0.0.5";
            plugin2.Method = "method";
            plugin2.Name = "plugin2";
            plugin2.Text = "�����2";
            plugin2.Url = "pluginurl";
            plugin2.Tel = "tel";

            soft.Plugins.Add(plugin2);
        }
        * */
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                /*
                PluginInfo plugin2 = new PluginInfo();
                plugin2.CategoryIndex = 2;
                plugin2.ChangeLogPath = "plugin2.changelog.log";
                plugin2.Company = "plugin2company";
                plugin2.Developer = "develper2";
                plugin2.Email = "email";
                //plugin2.Img = null;
                plugin2.IsDeploy = false;
                plugin2.IsGlobalization = false;
                plugin2.MainVersion = "2.0.0.5";
                plugin2.Method = "method";
                plugin2.Name = "plugin2";
                plugin2.Text = "�����2";
                plugin2.Url = "pluginurl";
                plugin2.Tel = "tel";

                this.textBox1.Text = SerializeHelper.SerializeToXml(plugin2);
                 * */
                SoftInfo soft = new SoftInfo();
                soft.ChangeLogPath = "c:\\changelog.log";
                soft.Company = "fm-company";
                soft.Developer = "austin chen";
                soft.Email = "*****@*****.**";
                soft.IsDeploy = true;
                soft.IsGlobalization = true;
                soft.MainVersion = "1.0.0.1";
                soft.Name = "��УԤ¼��ϵͳ";
                soft.Tel = "15912345678";
                soft.Url = "http://www.hutong.com";
                RegInfo reginfo = new RegInfo();
                reginfo.BeginDate = new DateTime(2007, 12, 12);
                reginfo.LastDate = new DateTime(2008, 1, 1);
                reginfo.MachineCode = "machinecode";
                reginfo.RegCode = "regcode";
                reginfo.UserName = "******";
                reginfo.UseTimes = 100;
                soft.RegInfo = reginfo;
                PluginInfo plugin1 = new PluginInfo();
                plugin1.CategoryIndex = 1;
                plugin1.ChangeLogPath = "plugin1.changelog.log";
                plugin1.Company = "plugin1company";
                plugin1.Developer = "develper1";
                plugin1.Email = "email";
                // plugin1.Img = null;
                plugin1.IsDeploy = false;
                plugin1.IsGlobalization = false;
                plugin1.MainVersion = "2.0.0.5";
                plugin1.Method = "method";
                plugin1.Name = "plugin1";
                plugin1.Text = "�����";
                plugin1.Url = "pluginurl";
                plugin1.Tel = "tel";
                soft.Plugins.Add(plugin1);

                PluginInfo plugin2 = new PluginInfo();
                plugin2.CategoryIndex = 2;
                plugin2.ChangeLogPath = "plugin2.changelog.log";
                plugin2.Company = "plugin2company";
                plugin2.Developer = "develper2";
                plugin2.Email = "email";
                //plugin2.Img = null;
                plugin2.IsDeploy = false;
                plugin2.IsGlobalization = false;
                plugin2.MainVersion = "2.0.0.5";
                plugin2.Method = "method";
                plugin2.Name = "plugin2";
                plugin2.Text = "�����2";
                plugin2.Url = "pluginurl";
                plugin2.Tel = "tel";

                soft.Plugins.Add(plugin2);
               // string temp = "<![CDATA[" + SerializeHelper.SerializeToXml(soft) + "]]>";
              //  SerializeSupport support = new SerializeSupport();
              //  support.data = temp;
              //  this.textBox1.Text = SerializeHelper.SerializeToXml(support);

                 this.textBox1.Text = SerializeHelper.SerializeToXml(soft);
            }
            catch (Exception ex)
            {
                System.Console.Write(ex.StackTrace);
                string tmp = "";
            }
        }
Ejemplo n.º 12
0
        /* public SoftInfo soft=new SoftInfo();
         *
         * private void InitSoftInfo()
         * {
         *   soft.ChangeLogPath = "c:\\changelog.log";
         *   soft.Company = "fm-company";
         *   soft.Developer = "austin chen";
         *   soft.Email = "*****@*****.**";
         *   soft.IsDeploy = true;
         *   soft.IsGlobalization = true;
         *   soft.MainVersion = "1.0.0.1";
         *   soft.Name = "驾校预录入系统";
         *   soft.Tel = "15912345678";
         *   soft.Url = "http://www.hutong.com";
         *   RegInfo reginfo=new RegInfo();
         *   reginfo.BeginDate=new DateTime(2007,12,12);
         *   reginfo.LastDate=new DateTime(2008,1,1);
         *   reginfo.MachineCode="machinecode";
         *   reginfo.RegCode="regcode";
         *   reginfo.UserName="******";
         *   reginfo.UseTimes=100;
         *   soft.RegInfo = reginfo;
         *   PluginInfo plugin1 = new PluginInfo();
         *   plugin1.CategoryIndex = 1;
         *   plugin1.ChangeLogPath = "plugin1.changelog.log";
         *   plugin1.Company = "plugin1company";
         *   plugin1.Developer = "develper1";
         *   plugin1.Email = "email";
         *  // plugin1.Img = null;
         *   plugin1.IsDeploy = false;
         *   plugin1.IsGlobalization = false;
         *   plugin1.MainVersion="2.0.0.5";
         *   plugin1.Method = "method";
         *   plugin1.Name = "plugin1";
         *   plugin1.Text = "生活工具";
         *   plugin1.Url = "pluginurl";
         *   plugin1.Tel = "tel";
         *   soft.Plugins.Add(plugin1);
         *
         *   PluginInfo plugin2 = new PluginInfo();
         *   plugin2.CategoryIndex = 2;
         *   plugin2.ChangeLogPath = "plugin2.changelog.log";
         *   plugin2.Company = "plugin2company";
         *   plugin2.Developer = "develper2";
         *   plugin2.Email = "email";
         *   //plugin2.Img = null;
         *   plugin2.IsDeploy = false;
         *   plugin2.IsGlobalization = false;
         *   plugin2.MainVersion = "2.0.0.5";
         *   plugin2.Method = "method";
         *   plugin2.Name = "plugin2";
         *   plugin2.Text = "生活工具2";
         *   plugin2.Url = "pluginurl";
         *   plugin2.Tel = "tel";
         *
         *   soft.Plugins.Add(plugin2);
         * }
         * */

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                /*
                 * PluginInfo plugin2 = new PluginInfo();
                 * plugin2.CategoryIndex = 2;
                 * plugin2.ChangeLogPath = "plugin2.changelog.log";
                 * plugin2.Company = "plugin2company";
                 * plugin2.Developer = "develper2";
                 * plugin2.Email = "email";
                 * //plugin2.Img = null;
                 * plugin2.IsDeploy = false;
                 * plugin2.IsGlobalization = false;
                 * plugin2.MainVersion = "2.0.0.5";
                 * plugin2.Method = "method";
                 * plugin2.Name = "plugin2";
                 * plugin2.Text = "生活工具2";
                 * plugin2.Url = "pluginurl";
                 * plugin2.Tel = "tel";
                 *
                 * this.textBox1.Text = SerializeHelper.SerializeToXml(plugin2);
                 * */
                SoftInfo soft = new SoftInfo();
                soft.ChangeLogPath   = "c:\\changelog.log";
                soft.Company         = "fm-company";
                soft.Developer       = "austin chen";
                soft.Email           = "*****@*****.**";
                soft.IsDeploy        = true;
                soft.IsGlobalization = true;
                soft.MainVersion     = "1.0.0.1";
                soft.Name            = "驾校预录入系统";
                soft.Tel             = "15912345678";
                soft.Url             = "http://www.hutong.com";
                RegInfo reginfo = new RegInfo();
                reginfo.BeginDate   = new DateTime(2007, 12, 12);
                reginfo.LastDate    = new DateTime(2008, 1, 1);
                reginfo.MachineCode = "machinecode";
                reginfo.RegCode     = "regcode";
                reginfo.UserName    = "******";
                reginfo.UseTimes    = 100;
                soft.RegInfo        = reginfo;
                PluginInfo plugin1 = new PluginInfo();
                plugin1.CategoryIndex = 1;
                plugin1.ChangeLogPath = "plugin1.changelog.log";
                plugin1.Company       = "plugin1company";
                plugin1.Developer     = "develper1";
                plugin1.Email         = "email";
                // plugin1.Img = null;
                plugin1.IsDeploy        = false;
                plugin1.IsGlobalization = false;
                plugin1.MainVersion     = "2.0.0.5";
                plugin1.Method          = "method";
                plugin1.Name            = "plugin1";
                plugin1.Text            = "生活工具";
                plugin1.Url             = "pluginurl";
                plugin1.Tel             = "tel";
                soft.Plugins.Add(plugin1);

                PluginInfo plugin2 = new PluginInfo();
                plugin2.CategoryIndex = 2;
                plugin2.ChangeLogPath = "plugin2.changelog.log";
                plugin2.Company       = "plugin2company";
                plugin2.Developer     = "develper2";
                plugin2.Email         = "email";
                //plugin2.Img = null;
                plugin2.IsDeploy        = false;
                plugin2.IsGlobalization = false;
                plugin2.MainVersion     = "2.0.0.5";
                plugin2.Method          = "method";
                plugin2.Name            = "plugin2";
                plugin2.Text            = "生活工具2";
                plugin2.Url             = "pluginurl";
                plugin2.Tel             = "tel";

                soft.Plugins.Add(plugin2);
                // string temp = "<![CDATA[" + SerializeHelper.SerializeToXml(soft) + "]]>";
                //  SerializeSupport support = new SerializeSupport();
                //  support.data = temp;
                //  this.textBox1.Text = SerializeHelper.SerializeToXml(support);

                this.textBox1.Text = SerializeHelper.SerializeToXml(soft);
            }
            catch (Exception ex)
            {
                System.Console.Write(ex.StackTrace);
                string tmp = "";
            }
        }