golang NTLM认证问题

内网一个站需要NTLM认证,才能访问和下载
C#代码如下:如何改成golang的呢?

            WebRequest request = WebRequest.Create("http://192.168.0.252/sites/电厂.ppt");   
            request.Credentials =  new NetworkCredential("pp\user", "pass", "pp");
            WebResponse response = request.GetResponse();   
            Stream reader = response.GetResponseStream();   

            FileStream writer = new FileStream("D://down.ppt", FileMode.OpenOrCreate, FileAccess.Write);   
            byte[] buff = new byte[512];   
            int c = 0; //实际读取的字节数    
            while ((c=reader.Read(buff, 0, buff.Length)) > 0)   
            {   
                writer.Write(buff, 0, c);   
            }   
            writer.Close();   
            writer.Dispose();   

            reader.Close();   
            reader.Dispose();   
            response.Close();

共 2 个回复


xiaolunwen

应该是需要Windows API支持吧

# 0