Hi experts,
I want to create a new empty text file after I upload a file to
the desination. Then I need to read each line from the uploaded file
and write the lines which first character <>'6' to the new
file.
Can someone show me how to do this? First of all, what is the syntax
to create a new text file? Thank you.
This is the funcation for upload file:
-----------------------------------------------------------------
Sub Upload_Click(By Val source As Object, ByVal e As EventArgs)
Dim savePath As String = "C:\temp\"
Dim postedFile = uploadedFile.Po stedFile
Dim filename As String =
Path.GetFileNam e(postedFile.Fi leName)
Dim contentType As String = postedFile.Cont entType
Dim contentLength As Integer = postedFile.Cont entLength
If Not (uploadedFile.P ostedFile Is Nothing) Then
Try
'upload file to destination directory
postedFile.Save As(savePath & filename)
message.Text = postedFile.File name & " uploaded"
& _
"<br>conten t type: " & contentType &
_
"<br>conten t length: " &
contentLength.T oString()
Catch exc As Exception
message.Text = "Failed uploading file"
End Try
End If
'Create a new text file
End Sub
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*