Mark,
I was able to create the file and even write back to the html using the
streamwriter and the replace() function. I placed the write procedure
within an if statement that checked for the existence of the original phrase
and even though the procedure ran without error, it didn't replace the
string. Then I looked further down on the page, several lines down in the
body, and saw that it wrote my replacement string down there where the
original phrase was not.
I'm so close, but do you know why it wrote where it did? Below is a snippet
of the code. Note that I'm really only checking the first line of the page.
Dim FS As FileStream, LineText As String = Nothing
FS = New FileStream(FileName, FileMode.Open,
FileAccess.ReadWrite, FileShare.ReadWrite)
Dim SR As New StreamReader(FS) ', SW As New StreamWriter(FS)
Dim itm As String = SR.ReadLine
While Not itm = Nothing
If Microsoft.VisualBasic.InStr(itm, "Full_Listing") > 0 Then
Dim SW As New StreamWriter(FS)
SW.WriteLine(Microsoft.VisualBasic.Replace(itm,
"Full_Listing", "Natarajan_Asokan"))
SW.Close()
Me.labMsg.Text = "Updated!"
Else
Me.labMsg.Text = "Didn't find it"
End If
X = X + 1
If X = 1 Then Exit While
End While
SR.Close()
FS.Close()
Thanks, again, for the assistance.
Ross
"Mark Rae [MVP]" <> wrote in message
news:...
> "Ross Culver" <> wrote in message
> news:...
>
>>I need to be able to create a new aspx file for new users that are
>>specific and optimized for that user. For instance, Joe Blow clicks a
>>button and Joe_Blow.aspx is created.
>>
>> I can create the file, no problem, by copying a template file and
>> renaming it. But I need to be able to change the Title, description and
>> keywords html tags for that new page automatically.
>>
>> Is that even possible?
>
> Several solutions...
>
> I'd probably just use the System.IO namespace to open the newly created
> file, read its contents, do a find and replace as necessary and then save
> the file...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net