简体   繁体   中英

Faster way to access a file on a Windows 7 network share?

There is an intermittent speed issue with accessing network shares on a Windows 7 machine that ruins the functioning of my program. Basically, when my program first attempts to access the network share, there is a 7-second lag before the access takes place. Subsequent attempts to access the file occur instantly. But every now and again without restarting, the problem strikes again.

The problem occurs in Explorer as well, which led me to believe it was a Windows configuration issue. However, I tried every technique I could find (disabling auto-tuning and rss, turning off Remote Differential Compression, deselecting IPv6 and QoS, etc.) but it did not fix the lag in Explorer.

This seems to be a general networking issue in Win7, but I was wondering if any C# programmers had found smarter ways to access files that somehow eliminated this lag. I was thinking that perhaps Explorer tries to do a little extra indexing, drive-locating etc. that slows it down. I was hoping there might be a file access procedure in C# (turning off a flag or two or something), that will help me access the file without lag.

Is there a faster way to access a file on a Windows 7 network share?

The issue was with nslookup taking a while to resolve the name. Using the IP of the network drive directly instead of using the name fixed the problem. We will probably end up putting all our addresses in the hosts file (system32\\drivers\\etc) for Windows.

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