Don’t underestimate the My object

Need a file from a secure network share?  Trying to actually understand the NetworkCredentials classes?  Good freakin luck!
I went through the snippets, searched google, and read the MSDN library cover to virtual cover before I just dialed in.
My.
Computer.
Network.
DownloadFile?  Does it have an overload with username and password?
Well I'll be a son of a ...
Final code:

My.Computer.Network.DownloadFile("\\192.168.1.3\share\point\test.xls", "c:\text.xls", "user", "password")

Works like a charm.

Comments are closed

Bill Sempf

Husband. Father. Pentester. Secure software composer. Brewer. Lockpicker. Ninja. Insurrectionist. Lumberjack. All words that have been used to describe me recently. I help people write more secure software.

PageList

profile for Bill Sempf on Stack Exchange, a network of free, community-driven Q&A sites

MonthList