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.IO;
namespace CSharp_Open_and_Save
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void save_Click(object sender, EventArgs e)
{
}
private void open_Click(object sender, EventArgs e)
{
}
}
}
[FONT=Consolas]if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)[/FONT][LEFT][FONT=Consolas] {[/FONT]
[FONT=Consolas] File.WriteAllText(saveFileDialog1.FileName, textBox1.Text);[/FONT][/LEFT]
[FONT=Consolas] }[/FONT]
[FONT=Consolas]if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)[/FONT][LEFT][FONT=Consolas] {
label1.Text = openFileDialog1.FileName;[/FONT]
[FONT=Consolas] textBox1.Text = File.ReadAllText(label1.Text);[/FONT][/LEFT]
[FONT=Consolas] }[/FONT]
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.IO;
namespace CSharp_Open_and_Save
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void save_Click(object sender, EventArgs e)
{
}
private void open_Click(object sender, EventArgs e)
{
}
}
}
[FONT=Consolas]if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)[/FONT][LEFT][FONT=Consolas] {[/FONT]
[FONT=Consolas] File.WriteAllText(saveFileDialog1.FileName, textBox1.Text);[/FONT][/LEFT]
[FONT=Consolas] }[/FONT]
[FONT=Consolas]if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)[/FONT][LEFT][FONT=Consolas] {
label1.Text = openFileDialog1.FileName;[/FONT]
[FONT=Consolas] textBox1.Text = File.ReadAllText(label1.Text);[/FONT][/LEFT]
[FONT=Consolas] }[/FONT]
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
File.WriteAllText(saveFileDialog1.FileName, textBox1.Text);
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
File.WriteAllText(saveFileDialog1.FileName, textBox1.Text);
string mystring = @"This is a test of the emergency broadcast system!";
byte[] myBytes = new byte[]{0x00, 0x0A, 0x0B};
BinaryWriter br = new BinaryWriter(new FileStream(@"c:\\myfile.dat", FileMode.OpenOrCreate));//FileMode has more options
br.Write(mystring);
br.Write(myBytes);
br.Close();
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.IO;
namespace CSharp_Open_and_Save
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void save_Click(object sender, EventArgs e)
{
}
private void open_Click(object sender, EventArgs e)
{
}
}
}
[FONT=Consolas]if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)[/FONT][LEFT][FONT=Consolas] {[/FONT]
[FONT=Consolas] File.WriteAllText(saveFileDialog1.FileName, textBox1.Text);[/FONT][/LEFT]
[FONT=Consolas] }[/FONT]
[FONT=Consolas]if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)[/FONT][LEFT][FONT=Consolas] {
label1.Text = openFileDialog1.FileName;[/FONT]
[FONT=Consolas] textBox1.Text = File.ReadAllText(label1.Text);[/FONT][/LEFT]
[FONT=Consolas] }[/FONT]
Copyright © 2024, NextGenUpdate.
All Rights Reserved.