I have to search for a text file located on C Drive of a different server and read the text file for lines of data
where there is a "File Error" message and copy the line.
there may be some functionality available in the FileSystemWatcher object (haven't used it). I would start their.
your process will require read/write access to the entire c:\ drive. I would consider this to be a hugh security risk. if at all possible i would place the files on a seperate drive, or at a minimum restrict it to a specific sub directory on the remote machine.
use new System.IO.FileInfo or System.IO.File to access the file. just pass the full path to the object.
use the System.IO.TextReader to read each line from the file into a IList<string>. close the stream/file.
process the data. open the file once your done, and write the changes back using System.IO.TextWriter.
How many servers are you dealing with? Are the files in the same location every time? What access do you have to the server? Do you have to access them over a LAN or a WAN?
I have to acess only one server which is on the same network as ours. It is LAN and I have a user name and password. The file is located in the C drive. thank you
I have to search the file but i have all the code to do that in place. i am having problem just to connect to the server and accessing the c drive. thanks again
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.