H
han.c.h
Guest
ini파일을 datagridview에 올리고 띄우고 싶은데요 - HOONS닷넷
When I enter the URL above,
I try to put data into the grid and press the export button to save it as an .ini file in the form of section, key, value. What should I do? Inside the code, the content is created as an ini file, but not as a grid.
I want to see the generated ini file by putting it in the datagridview and pressing the export button instead of putting section,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
namespace EXPORT
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
[DllImport('kernel32')]
public static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport('kernel32')]
public static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
static string path = 'C:\\Test.ini';
public Form1()
{
InitializeComponent();
dataGridView1.AllowUserToAddRows =true; //자동 행 추가
dataGridView1.AutoGenerateColumns = false;
}
private void button1_Click(object sender, EventArgs e)
{
WritePrivateProfileString('SECTION', 'KEY', 'VALUE', @'C:\ConnectionInfo.ini');
MessageBox.Show('EXPORT successfully to *.INI format');
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void WriteInFile(string section,string key,string value,string path)
{
WritePrivateProfileString(section, key, value, path);
if (value == null)
{
throw new ArgumentException();
}
}
private void button2_Click(object sender, EventArgs e) //ADD_ROW Button
{
DataGridViewButtonColumn button = new DataGridViewButtonColumn();
{
dataGridView1.Rows.Add();
}
}
}
}
Continue reading...
When I enter the URL above,
I try to put data into the grid and press the export button to save it as an .ini file in the form of section, key, value. What should I do? Inside the code, the content is created as an ini file, but not as a grid.
I want to see the generated ini file by putting it in the datagridview and pressing the export button instead of putting section,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
namespace EXPORT
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
[DllImport('kernel32')]
public static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport('kernel32')]
public static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
static string path = 'C:\\Test.ini';
public Form1()
{
InitializeComponent();
dataGridView1.AllowUserToAddRows =true; //자동 행 추가
dataGridView1.AutoGenerateColumns = false;
}
private void button1_Click(object sender, EventArgs e)
{
WritePrivateProfileString('SECTION', 'KEY', 'VALUE', @'C:\ConnectionInfo.ini');
MessageBox.Show('EXPORT successfully to *.INI format');
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void WriteInFile(string section,string key,string value,string path)
{
WritePrivateProfileString(section, key, value, path);
if (value == null)
{
throw new ArgumentException();
}
}
private void button2_Click(object sender, EventArgs e) //ADD_ROW Button
{
DataGridViewButtonColumn button = new DataGridViewButtonColumn();
{
dataGridView1.Rows.Add();
}
}
}
}
Continue reading...