Click here to Skip to main content
15,878,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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....
C#
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
        }
Posted
Updated 27-Feb-13 0:00am
v2

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900