在asp.net中根据大小拆分上传文本文件? [英] Split upload textfile based on size in asp.net?
本文介绍了在asp.net中根据大小拆分上传文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何根据文件大小拆分上传的文本文件???
我可以根据点数(。)进行拆分......但我需要根据大小进行拆分..
i尝试低于编码分割....
textt =会话[ filepath]。ToString();
// conn.Open();
string path = textt;
int i = 0 ;
foreach ( string line in File.ReadAllLines(textt))
{
string [] parts = line.Split( ' 。');
foreach ( string part in 部分)
{
string Text = Encrypt(part);
TextBox1.Text = Text;
SqlCommand cmd = new SqlCommand( Insert分裂值(' + Session [ count]。ToString()+ ',' + TextBox1.Text + '),conn);
int iCount = cmd.ExecuteNonQuery();
// conn.Close();
响应。写(部分);
}
i ++; // 仅限演示
}
解决方案
看一下这个链接
将文本文件拆分成几个基于输出文件的大小 [ ^ ]
如何将文本文件拆分为多个smalelr文件 [ ^ ]
如何拆分大文本文件32-gb使用c-sharp [ ^ ]
祝你好运,
OI
How to split uploaded text file based on the file size???
I can split based on the dot poisition(.)...but i need to split based on the size..
i tried below coding for split....
textt = Session["filepath"].ToString();
// conn.Open();
string path = textt;
int i = 0;
foreach (string line in File.ReadAllLines(textt))
{
string[] parts = line.Split('.');
foreach (string part in parts)
{
string Text = Encrypt(part);
TextBox1.Text = Text;
SqlCommand cmd = new SqlCommand("Insert into split values('" + Session["count"].ToString() + "','" +TextBox1.Text +"')",conn);
int iCount = cmd.ExecuteNonQuery();
// conn.Close();
Response.Write(part);
}
i++; // For demo only
}
解决方案
Have a look at this link
Split text file into several based output file size[^]
How to split text file into multiple smalelr files [^]
How to split the large text file 32-gb using c-sharp[^]
Good luck,
OI
这篇关于在asp.net中根据大小拆分上传文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文