Hi,
I am new to programming and very new to C#. I appreciate all the help that I could get. Thanks much,
Console Application--
--1) I have a UserName and Password and IP Address of a Server which is on the same network as mine.
--2) I want to access that Server.
--3) I want to open and search a log file located in C:\Develop\ (on that Server) for lines which contain "Copy not sent" and if this string is found, I want to copy the whole line. The log files are created every day as mmddyy.txt. I want to check for the latest file.
ShawnPosted Aug 9, 2007, 10:42 AM
Oh, no help in this forum...why is it so?
ForgottenhartPosted Aug 9, 2007, 9:37 AM
ShawnPosted Aug 9, 2007, 7:45 AM
dim fPath as string = "\\server\folder\mmddyy.txt"
Dim fStream As FileStream = New FileStream(fPath, FileMode.Open, FileAccess.Read, FileShare.Read)
dim fr as new streamReader(fStream)
while not fr.EndOfStream
dim lineText as string = fr.Read
if instr(lineText,"Copy not sent") <> 0 Then
'do something with it
end if
end while
But I don't know how to do it in C#. I do not know how to search for the latest mmddyy.txt in the folder. and the biggest do not know is how to access the server where the files reside. the server is on the same network and it has a username and password to connect to
thank you much