public class cinter
{
[DllImport("C:\\Documents and Settings\\rdjrdj\\桌面\\Web0914\\c-inter.dll")]
public static extern void comp(int argc, string[] argv);
}
public class bsdl
{
[DllImport("C:\\Documents and Settings\\rdjrdj\\桌面\\Web0914\\bsdl.dll")]
public static extern void comp(int argc, string[] argv);
}
public class intervb
{
[DllImport("C:\\Documents and Settings\\rdjrdj\\桌面\\Web0914\\intervb.dll")]
public static extern void comp(int argc, string[] argv);
}// 这些是为了调用dll函数写的
if(astr=="c"&&bstr=="inter")
{
string[] b = new string[5];
b[1] = "a.txt";
cinter.comp(1, b); }//调用第一个dll
FileStream f = new FileStream("t.txt", FileMode.Open, FileAccess.ReadWrite);
StreamReader s = new StreamReader(f);
s.BaseStream.Seek(0, SeekOrigin.Begin);
TextBox2.Text = s.ReadToEnd();
s.Close();
f.Close();
}
else if (astr == "bsdl" && bstr == "data")
{
string[] b = new string[5];
b[1] = "a.txt";
bsdl.comp(1, b);//调用第二个dll
FileStream f = new FileStream("t.txt", FileMode.Open, FileAccess.ReadWrite);
StreamReader s = new StreamReader(f);
s.BaseStream.Seek(0, SeekOrigin.Begin);
TextBox2.Text = s.ReadToEnd();
s.Close();
f.Close();
}
else if (astr == "inter" && bstr == "vb")
{
string[] b = new string[5];
b[1] = "a.txt";
intervb.comp(1, b);]//调用第三个dll
FileStream f = new FileStream("t.txt", FileMode.Open, FileAccess.ReadWrite);
StreamReader s = new StreamReader(f);
s.BaseStream.Seek(0, SeekOrigin.Begin);
TextBox2.Text = s.ReadToEnd();
s.Close();
f.Close();
}
第一个dll调用的结果正确的,第二三个就不正确了,这三个dll功能差不多就是分析出来的结果不一样,但dll内部函数的结构及所用到的东西基本一致。这是为什么啊????
{
[DllImport("C:\\Documents and Settings\\rdjrdj\\桌面\\Web0914\\c-inter.dll")]
public static extern void comp(int argc, string[] argv);
}
public class bsdl
{
[DllImport("C:\\Documents and Settings\\rdjrdj\\桌面\\Web0914\\bsdl.dll")]
public static extern void comp(int argc, string[] argv);
}
public class intervb
{
[DllImport("C:\\Documents and Settings\\rdjrdj\\桌面\\Web0914\\intervb.dll")]
public static extern void comp(int argc, string[] argv);
}// 这些是为了调用dll函数写的
if(astr=="c"&&bstr=="inter")
{
string[] b = new string[5];
b[1] = "a.txt";
cinter.comp(1, b); }//调用第一个dll
FileStream f = new FileStream("t.txt", FileMode.Open, FileAccess.ReadWrite);
StreamReader s = new StreamReader(f);
s.BaseStream.Seek(0, SeekOrigin.Begin);
TextBox2.Text = s.ReadToEnd();
s.Close();
f.Close();
}
else if (astr == "bsdl" && bstr == "data")
{
string[] b = new string[5];
b[1] = "a.txt";
bsdl.comp(1, b);//调用第二个dll
FileStream f = new FileStream("t.txt", FileMode.Open, FileAccess.ReadWrite);
StreamReader s = new StreamReader(f);
s.BaseStream.Seek(0, SeekOrigin.Begin);
TextBox2.Text = s.ReadToEnd();
s.Close();
f.Close();
}
else if (astr == "inter" && bstr == "vb")
{
string[] b = new string[5];
b[1] = "a.txt";
intervb.comp(1, b);]//调用第三个dll
FileStream f = new FileStream("t.txt", FileMode.Open, FileAccess.ReadWrite);
StreamReader s = new StreamReader(f);
s.BaseStream.Seek(0, SeekOrigin.Begin);
TextBox2.Text = s.ReadToEnd();
s.Close();
f.Close();
}
第一个dll调用的结果正确的,第二三个就不正确了,这三个dll功能差不多就是分析出来的结果不一样,但dll内部函数的结构及所用到的东西基本一致。这是为什么啊????
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货