using System.Xml;
using System.Xml.XPath;
string jg="0.00";
double myhjg=0;
double zzjg=0;
private void text1_TextChanged(object sender, System.EventArgs e)
{
dhx2=text1.Lines.Length;
int hw=0;
hw=dhx2-1;
string[] mhsj;
mhsj=new string[dhx2];
string[] mhszfhzf=new string[dhx2];
string[] mhszfhzf1=new string[dhx2];
try
{
for(int i=0;i<dhx2;i++)
{
mhsj[i]=text1.Lines[i];
string[] dgzf;
dgzf=new string[mhsj[i].Length];
int j,h;
for(j=0;j<mhsj[i].Length;j++)
{
dgzf[j]=mhsj[i].Substring(j,1);
if(dgzf[j].Equals("%")==true)
{
dgzf[j]="*0.01";
}
}
for(int k=0;k<mhsj[i].Length;k++)
{
if(dgzf[k].Equals("/")==true)
{
if (char.IsNumber(dgzf[k+1],0)==true)
{
dgzf[k]=dgzf[k];
}
else
{
dgzf[k]="每";
}
}
}
for(h=0;h<j;h++)
{
if(char.IsNumber(dgzf[h],0)==true ||char.IsPunctuation(dgzf[h],0)==true ||char.IsSymbol(dgzf[h],0)==true)
{
mhszfhzf[i]=mhszfhzf[i]+dgzf[h];
}
}
}
}
catch(Exception)
{
}
try
{
mhszfhzf1[hw]=mhszfhzf[hw].Replace("/"," div ");
XmlDocument xd=new XmlDocument();
XPathNavigator jszhs=xd.CreateNavigator();
myhjg=(double)jszhs.Evaluate(mhszfhzf1[hw]);
}
catch(Exception)
{
}
}
private void text1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
System.EventArgs z;
z=new EventArgs();
if(e.KeyChar==13)
{
zzjg+=myhjg;
jg=zzjg.ToString();
}
}