seecord

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using SEE.common;
using SEE.service;
using SEE.AppClass;
using System.Text.RegularExpressions;
using System.IO;

namespace SEE
{
    public partial class frmRegist : DevComponents.DotNetBar.Office2007Form
    {
        public frmRegist()
        {
            InitializeComponent();
        }
        public frmRegist(string number)
        {
            InitializeComponent();
            this.m_objCommonService = new CommonService();
            this.textBoxID.Text = number;
        }

        private CommonService m_objCommonService;
       
        private void buttonX2_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
        }

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

        private void buttonCreateID_Click(object sender, EventArgs e)
        {
            string[] mocs = clsSystemParam.GetMoc();

            this.textBoxID.Text = mocs[1];
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("IEXPLORE.EXE", AppDomain.CurrentDomain.BaseDirectory+"registerdemo.html");  
        }
       
        private string GetStrAToZAndNumber(string sourceStr)
        {
            string str20 = sourceStr;
            string strSplit1;
            strSplit1 = Regex.Replace(str20, "![a-z0-9]", "", RegexOptions.IgnoreCase);
            if (strSplit1.Length > 8)
            {
                return strSplit1.Substring(0, 7);
            }
            else
                return strSplit1.PadRight(8, 'a');
        }
        private void buttonRegist_Click(object sender, EventArgs e)
        {
            if (this.textBoxID.Text.Trim() != "" && this.textBoxRegistMark.Text.Trim() != "" && this.textBox1.Text.Trim() != "" &&

this.textBox3.Text.Trim()!="" && this.textBox4.Text.Trim()!="" && this.textBox5.Text.Trim()!="" && this.textBox6.Text.Trim()!="")
            {
                string registMark = "";
                registMark = this.textBoxRegistMark.Text.Trim() + this.textBox3.Text.Trim() + this.textBox4.Text.Trim() +

this.textBox5.Text.Trim() + this.textBox6.Text.Trim();
                //GetStrAToZAndNumber(SEE.common.DES.Encrypt(this.textBoxID.Text.Trim(), this.textBoxID.Text.Trim().ToLower() +

"abc"))
                SEE.RegCenter.Service1 regcenter = new SEE.RegCenter.Service1();
                string returnstring ="0,请稍后注册。";
                try{
                returnstring  = regcenter.CheckReg(this.textBoxRegistMark.Text.Trim(), this.textBox3.Text.Trim(),

this.textBox4.Text.Trim(), this.textBox5.Text.Trim(), this.textBox6.Text.Trim(), this.textBox1.Text.Trim(), this.textBoxID.Text.Trim(),

SEE.common.Config.GetConfigsNode("seesoft", "industry"));
                }
                catch(Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show("注册过程中网络出现异常,请稍候再进行注册。","SeeSoft提示信息");
                    return;
                }
                //System.Windows.Forms.MessageBox.Show(returnstring, "SeeSoft提示信息");
                string[] restringarray = returnstring.Split(',');
                if (restringarray[0] == "1000")
                {
                    this.m_objCommonService.InsertRegInfomation(this.textBoxID.Text.Trim(), restringarray[1].Substring(0, 100));
                    this.m_objCommonService.InsertRegCompany(this.textBox1.Text.Trim(), "1");
                    System.IO.File.Delete(AppDomain.CurrentDomain.BaseDirectory + "//see.ini");
                    StreamWriter M_Writer = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + "//see.ini");
                    lock (M_Writer)
                    {
                        try
                        {
                            M_Writer.WriteLine(registMark + this.textBox1.Text + this.textBoxID.Text + SEE.common.Config.GetConfigsNode

("seesoft", "industry"));
                            M_Writer.Flush();
                        }
                        finally
                        {
                            M_Writer.Close();
                        }
                    }
                    System.Windows.Forms.MessageBox.Show( "软件注册完毕,请重新启动本软件","SeeSoft提示信息");
                    this.Close();
                    this.Dispose();
                }
                else
                {
                        System.Windows.Forms.MessageBox.Show(restringarray[1].Replace("行业,",""),"SeeSoft提示信息");
                        return;
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("请正确输入信息");
            }
        }
    }
}
//author:raytine
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值