HttpWebRequest make Add-in broken for Office 2003

M

myblind

Hi,
I'm developing Shared Add-in for Office 2003 with C#, and I'm confused by a
severity problem.

If the HttpWebRequest requested many times (6 to 9, not always), then the
add-in will never invoked until restart Office application.

below is the my code:

void AddinMenuClick() {
string url = "http://localhost/test.htm";
var request = (HttpWebRequest)HttpWebRequest.Create(url);
var response = request.GetResponse();
var stream = response.GetResponseStream();
var sr = new StreamReader(stream);
var html = sr.ReadToEnd();
stream.Close();

MessageBox.Show(html);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top