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

五迷三道 提交于 2019-12-11 13:44:49

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/17888107/faster-way-to-access-a-file-on-a-windows-7-network-share

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!