One can use below mentioned ASP.Net code upon the requirement to download file:
Dim fst As New FileStream(Server.MapPath("abc.txt"), FileMode.Open)
Dim fl As String
if = "abc.txt"
Dim bytBytes(fst.Length) As Byte
fst.Read(bytBytes, 0, fst.Length)
fst.Close()
Response.AddHeader("Content-disposition", "attachment; filename=" & fl)
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(bytBytes)
Dim fst As New FileStream(Server.MapPath("abc.txt"), FileMode.Open)
Dim fl As String
if = "abc.txt"
Dim bytBytes(fst.Length) As Byte
fst.Read(bytBytes, 0, fst.Length)
fst.Close()
Response.AddHeader("Content-disposition", "attachment; filename=" & fl)
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(bytBytes)