V
vishal
Hello,
I have a created a windows service and now I need to
create some files from that windows service. The files
should be located in the following folder: /root/news/
Unfortunaly when the service runs then it throughs the
following error message and therefore it doesnt create the
file.
URI formats are not supported.
Here is my code:
Dim fp As StreamWriter
Try
'fp = File.CreateText(Server.MapPath("/news/")
& strPostPath)
Dim strPath =
System.Reflection.Assembly.GetExecutingAssembly().GetName
().CodeBase
fp = File.CreateText(strPath & "/news/" &
strPostPath)
fp.WriteLine("<p>" &
System.Web.HttpUtility.HtmlDecode(strPost) & "</p>")
' Close the stream writer
fp.Close()
Catch err As Exception
MyLog.Source = "Service1"
MyLog.WriteEntry("CREATE_FILE_ERROR:" &
err.Message)
Finally
End Try
I have a created a windows service and now I need to
create some files from that windows service. The files
should be located in the following folder: /root/news/
Unfortunaly when the service runs then it throughs the
following error message and therefore it doesnt create the
file.
URI formats are not supported.
Here is my code:
Dim fp As StreamWriter
Try
'fp = File.CreateText(Server.MapPath("/news/")
& strPostPath)
Dim strPath =
System.Reflection.Assembly.GetExecutingAssembly().GetName
().CodeBase
fp = File.CreateText(strPath & "/news/" &
strPostPath)
fp.WriteLine("<p>" &
System.Web.HttpUtility.HtmlDecode(strPost) & "</p>")
' Close the stream writer
fp.Close()
Catch err As Exception
MyLog.Source = "Service1"
MyLog.WriteEntry("CREATE_FILE_ERROR:" &
err.Message)
Finally
End Try