请问在c#编程中如何使用delphi7的dll?
解决方案 »
- 谁用.Net的C/S结构做过电子拣货系统 怎样用程序写LED灯开启/熄灭/闪烁的程序 急
- 关于string 引用类型问题?高分!
- 对Intel AMT技术了解的请进
- 用动态生成的TreevViee导航动态改变GridView中显示的数据,为什么一点TreeView的节点GridView就不见了?
- 请问哪位知道心电仪器上的曲线图c#显示实现(实时的从数据库取出数据然后像心电仪器一样显示出来)急用,在线等
- 线程同步???
- VS2008转化VS2005项目。。。会的进。。。。
- 委托和事件的使用
- 有关WinForm打印的问题
- 有关解决方案的问题!
- 请问这是什么写法?
- 请问,我想我的程序不被别人拷贝使用?就是换了台机器,就不能使用,用什么办法控制??
[DllImport("pcsCardDll.dll")]
public static extern int ReadAuthorCard(ref TParaBuf buf);
[DllImport("pcsCardDll.dll")]
public static extern int ReadAuthorCard(ref TParaBuf buf);--------------------------------------------------------------
qing wen shang mian dai ma xie zai na li?
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
namespace cs_finishi
{
/// <summary>
/// Summary description for Form1.
/// </summary>
///
public class RefDll
{
[DllImport(@"E:\StrSjisToJis.dll", EntryPoint="StrSjisTo",CharSet=CharSet.Ansi,
CallingConvention=CallingConvention.StdCall)]
public static extern string StrSjisTo(string str);
} public class Form1 : System.Windows.Forms.Form {
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} /// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(56, 40);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(192, 19);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(208, 104);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(64, 176);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(192, 19);
this.textBox2.TabIndex = 2;
this.textBox2.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 12);
this.ClientSize = new System.Drawing.Size(432, 317);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox2.Text=RefDll.StrSjisTo(textBox1.Text);
}
}
}