• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

[c#]:如何在C#中读写INI文件(三)

发布: 2007-7-01 11:09 | 作者: admin | 来源: | 查看: 18次 | 进入软件测试论坛讨论

领测软件测试网 using System ;

using System.Drawing ;

using System.Collections ;

using System.ComponentModel ;

using System.Windows.Forms ;

using System.Data ;

using System.Runtime.InteropServices ;

using System.Text ;

namespace C_操作INI文件__写操作

{

public class Form1 : System.Windows.Forms.Form

{

private System.Windows.Forms.Button button1 ;

private System.Windows.Forms.TextBox textBox1 ;

private System.Windows.Forms.Button button2 ;

private System.Windows.Forms.TextBox textBox2 ;

private System.Windows.Forms.TextBox textBox3 ;

private System.Windows.Forms.TextBox textBox4 ;

private System.Windows.Forms.Label label1 ;

private System.Windows.Forms.Label label2 ;

private System.Windows.Forms.Label label3 ;

private System.Windows.Forms.Button button3 ;

private System.Windows.Forms.OpenFileDialog openFileDialog1 ;

private System.ComponentModel.Container components = null ;

public Form1 ( )

{

InitializeComponent ( ) ;

}

protected override void Dispose ( bool disposing )

{

if ( disposing )

{

if ( components != null )

{

components.Dispose ( ) ;

}

}

base.Dispose ( disposing ) ;

}



[ DllImport ( "kernel32" ) ]

private static extern long WritePrivateProfileString ( string

section ,

string key , string val , string filePath ) ;

[ DllImport ( "kernel32" ) ]

private static extern int GetPrivateProfileString ( string section ,

string key , string def , StringBuilder retVal ,

int size , string filePath ) ;

private void InitializeComponent ( )

{

this.button1 = new System.Windows.Forms.Button ( ) ;

this.textBox1 = new System.Windows.Forms.TextBox ( ) ;

this.button2 = new System.Windows.Forms.Button ( ) ;

this.textBox2 = new System.Windows.Forms.TextBox ( ) ;

this.textBox3 = new System.Windows.Forms.TextBox ( ) ;

this.textBox4 = new System.Windows.Forms.TextBox ( ) ;

this.label1 = new System.Windows.Forms.Label ( ) ;

this.label2 = new System.Windows.Forms.Label ( ) ;

this.label3 = new System.Windows.Forms.Label ( ) ;

this.button3 = new System.Windows.Forms.Button ( ) ;

this.openFileDialog1 = new

System.Windows.Forms.OpenFileDialog ( ) ;

this.SuspendLayout ( ) ;

this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat ;

this.button1.Location = new System.Drawing.Point ( 238 , 20 ) ;

this.button1.Name = "button1" ;

this.button1.Size = new System.Drawing.Size ( 100 , 32 ) ;

this.button1.TabIndex = 0 ;

this.button1.Text = "选择INI文件" ;

this.button1.Click += new System.EventHandler ( this.button1_Click ) ;

this.textBox1.Location = new System.Drawing.Point ( 58 , 22 ) ;

this.textBox1.Name = "textBox1" ;

this.textBox1.Size = new System.Drawing.Size ( 162 , 21 ) ;

this.textBox1.TabIndex = 1 ;

this.textBox1.Text = "" ;

this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat ;

this.button2.Location = new System.Drawing.Point ( 86 , 168 ) ;

this.button2.Name = "button2" ;

this.button2.Size = new System.Drawing.Size ( 98 , 30 ) ;


延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网