G
Guest
Hello
My company has a java based application that can post a log file to a url
and I am trying to develop an ASP.Net web page to receive it and then store
the information in a SQL database. I am not sure how to do this and I have
ran across a couple of samples but they do not seem to work. Here is what I
have so far.
I am trying here to determine what key is being passed in order to pull the
value from it, but the output of the string variable is n/a which is it's
initial value.
Dim x As Object
Dim availableKeys As String = "n/a"
For Each x In Request.Form.Keys
If x.ToString <> Nothing Then
If availableKeys = "n/a" Then
availableKeys = x.ToString
Else
availableKeys = availableKeys & " " & x.ToString
End If
End If
Next
Here I am trying to read the value of what I think the key name is and then
writing it out to a file on the server as well as the availablekeys string
contents.
Dim serverRequest As String = Request.Form.Get("status")
Dim FileContents, FilePath As String
Dim sw As StreamWriter
FileContents = availableKeys & vbCrLf & vbCrLf & serverRequest
FilePath = MapPath("rawurl.txt")
sw = New StreamWriter(FilePath)
sw.Write(FileContents)
sw.Flush()
sw.Close()
when I receive the post the code does write out the availablekeys value
which is n/a but nothing else.
I have this site running on port 80 and the system does write out the files
so it should be a rights issue.
If anyone has any thoughts please responde.
My company has a java based application that can post a log file to a url
and I am trying to develop an ASP.Net web page to receive it and then store
the information in a SQL database. I am not sure how to do this and I have
ran across a couple of samples but they do not seem to work. Here is what I
have so far.
I am trying here to determine what key is being passed in order to pull the
value from it, but the output of the string variable is n/a which is it's
initial value.
Dim x As Object
Dim availableKeys As String = "n/a"
For Each x In Request.Form.Keys
If x.ToString <> Nothing Then
If availableKeys = "n/a" Then
availableKeys = x.ToString
Else
availableKeys = availableKeys & " " & x.ToString
End If
End If
Next
Here I am trying to read the value of what I think the key name is and then
writing it out to a file on the server as well as the availablekeys string
contents.
Dim serverRequest As String = Request.Form.Get("status")
Dim FileContents, FilePath As String
Dim sw As StreamWriter
FileContents = availableKeys & vbCrLf & vbCrLf & serverRequest
FilePath = MapPath("rawurl.txt")
sw = New StreamWriter(FilePath)
sw.Write(FileContents)
sw.Flush()
sw.Close()
when I receive the post the code does write out the availablekeys value
which is n/a but nothing else.
I have this site running on port 80 and the system does write out the files
so it should be a rights issue.
If anyone has any thoughts please responde.