3个回答
展开全部
读取txt:
private void Open()
{
openFileDialog1.Filter = "(*.txt)|*.txt";
openFileDialog1.FileName = "20110901.txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
recordPathMobile = openFileDialog1.FileName;
FileStream stream = new FileStream(recordPathMobile, FileMode.OpenOrCreate, FileAccess.Read);
....................
}
保存:
private void Store()
{
if (recordPathMobile == null)
{
Common.MsgInfo("请先选择需要导入的文本……");
return;
}
byte[] byDataBuf = null;
FileStream stream = new FileStream(recordPathMobile, FileMode.OpenOrCreate, FileAccess.Read);
byDataBuf = File.ReadAllBytes(recordPathMobile);
}
private void Open()
{
openFileDialog1.Filter = "(*.txt)|*.txt";
openFileDialog1.FileName = "20110901.txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
recordPathMobile = openFileDialog1.FileName;
FileStream stream = new FileStream(recordPathMobile, FileMode.OpenOrCreate, FileAccess.Read);
....................
}
保存:
private void Store()
{
if (recordPathMobile == null)
{
Common.MsgInfo("请先选择需要导入的文本……");
return;
}
byte[] byDataBuf = null;
FileStream stream = new FileStream(recordPathMobile, FileMode.OpenOrCreate, FileAccess.Read);
byDataBuf = File.ReadAllBytes(recordPathMobile);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1、读取txt文本到字符串
2、将字符串写入数据库
2、将字符串写入数据库
追问
能在详细点吗 写代码 谢谢
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
数据库中能直接存放txt文件的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询