PC Review


Reply
Thread Tools Rate Thread

401 Unauthorized reading file from UserControl

 
 
=?Utf-8?B?SmVmZg==?=
Guest
Posts: n/a
 
      1st Dec 2005
All,

I have a Windows Control Library, that I have imbeded into a web page. It
works great, with one exception. The control is to read a tif file for
display. The tif file is on a web server. I am using the following code:

Dim img As New
Bitmap(Image.FromStream(System.Net.HttpWebRequest.Create(tifURL).GetResponse().GetResponseStream()))

This results in the error:

"System.Net.WebException: The remote server returned an error: (401)
Unauthorized. at System.Net.HttpWebRequest.GetResponse() at
ImgViewer.Viewer.Viewer_Load(Object sender, EventArgs e) in
C:\teva\ImgViewer\Viewer.vb:line 12"

All I could find in help was to add this code, but it has no effect.


Dim myRegEx As New
System.Text.RegularExpressions.Regex("http://<myServer>/.*")
Dim myWebPermission As New
System.Net.WebPermission(System.Net.NetworkAccess.Connect, myRegEx)
myWebPermission.Demand()

Any help would be appreciated!!

Thanks,
Jeff


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PST file - encrypt against unauthorized access by Administrator KG Old Wolf Microsoft Outlook Discussion 1 8th Jan 2008 04:03 PM
How can I secure a file from unauthorized access? =?Utf-8?B?TWFyaw==?= Microsoft Excel Misc 1 24th May 2005 11:59 PM
IO.File.Delete gives me Unauthorized Access Exception =?Utf-8?B?TSBL?= Microsoft Dot NET Framework Forms 6 2nd Aug 2004 06:15 AM
Unauthorized exception when trying to download a file news.microsoft.com Microsoft Dot NET Framework Forms 1 12th Mar 2004 03:50 PM
Unauthorized exception when trying to download a file news.microsoft.com Microsoft Dot NET Framework Forms 0 11th Mar 2004 10:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 PM.