简体   繁体   中英

How to access files on the windows server 2003 programmatically

I'm trying to build logviewer for logfiles stored on our server.I know about the logviewers available on codeplex. But I'm looking to build something of my own. Here's what I need to do first and foremost. The log files are stored on server with address \\windows server address\\LogFiles. Over here there are various folders with names W3SVC69773105,W3SVC1208646085. Now I can't make head and shoulders of this folder name but each folder represents an application. Inside each folder there are log files for each day. I need to be able to get the latest file from the server, and then do parsing on it. I want to know how can I access this file located on server programmatically from my local machine.

Insofar as the folder names, it is actually pretty easy to generate them presuming you can access the IIS api. You see, W3CSVC4572 maps to IIS site ID #4572. So, you should have a log folder for each IIS site ID in a rather predictable pattern.

I'll resist my urge to ask why you are in fact reinventing the wheel. Except log parsing is alot less sexy a technology than wheels . . .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM