troubleshooting Question

Print webpage from windowsform in c#

Avatar of solarissf
solarissf asked on
.NET ProgrammingC#
4 Comments1 Solution1373 ViewsLast Modified:
Hello All,

Stuck on this and driving me crazy.

The end goal is to print an email in lotus notes automatically.  Already found the universalID of specific email.

Now I am trying to return url as a webpage through a proxy(using UNIVERSAL ID) and print it.  Due to fact that no matter what I try I cannot get lotusnotes to print it automatically.

I've been able to retreive webpage, but its the javascript I believe.

I am looking to print what the view is as if you looked at the website and hit print.  Not the code behind it.  

If I put the results of what I found in a form txtbox I only see the script of the webpage.

any ideas?

    public void FindWebPage()
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.msn.com");
        WebProxy myproxy = new WebProxy("http://autoproxy:81", false);
        myproxy.BypassProxyOnLocal = false;
        request.Proxy = myproxy;
        request.Method = "GET";
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();


        System.IO.Stream _WebStream = response.GetResponseStream();
        var reader = new StreamReader(_WebStream);
        string text = reader.ReadToEnd();
        txtEmailTest.Text = text;

Open in new window


here is the output
// Prudential Internet Access Services, report problem to SPOC @ 1-888-PRU-PRU9
// Dynamic Automatic Proxy Config - PLEASE DO NOT MODIFY
// Configuration Generated at Mon May 16 18:17:14 2011 UTC - proxy.pac : default
// Client IP: 48.27.193.68 | BROWSER:  | Region: default
ftpProxyAll    = "PROXY " + "48.19.199.100:8080"   + "; PROXY " + "48.135.149.100:8080" ;
gopherProxyAll = "PROXY " + "48.19.199.100:8080"   + "; PROXY " + "48.135.149.100:8080" ;
httpProxyAll   = "PROXY " + "48.19.199.100:8080"   + "; PROXY " + "48.135.149.100:8080" ;
httpsProxyAll  = "PROXY " + "48.19.199.100:8080"   + "; PROXY " + "48.135.149.100:8080" ;
trustProxyAll  = "PROXY " + "48.113.204.143:8080" + "; PROXY " + "48.114.150.143:8080" ;
internalProxyAll = "PROXY " + "" + "; PROXY " + "" ;
function FindProxyForURL(url, host) {
      if ( isPlainHostName(host) )
            return "DIRECT";
        else if ( localHostOrDomainIs(host, "prudential.your-locator.com") ||
          localHostOrDomainIs(host, "pruhomes.prudential.com") ||
        shExpMatch(host, "207.87.15.28") ||
          localHostOrDomainIs(host, "www.vicinity.com") ||
          localHostOrDomainIs(host, "myhr-ess.prudential.com") ||
          localHostOrDomainIs(host, "prudential.vicinity.com") ||
          localHostOrDomainIs(host, "www.geoaccess.com") ||
          localHostOrDomainIs(host, "advantage.prudential.com") ||
          (localHostOrDomainIs(host, "www.ups.com") && 
           (url.substring(0, 5).toLowerCase() == "http:")) ||
          (localHostOrDomainIs(host, "wwwapps.ups.com") && 
           (url.substring(0, 5).toLowerCase() == "http:")) ||
          (localHostOrDomainIs(host, "www.dhl.com") && 
           (url.substring(0, 5).toLowerCase() == "http:")) ||
          localHostOrDomainIs(host, "www.fedex.com")  ||
          localHostOrDomainIs(host, "www.axi.americanexpress.com") ||
          localHostOrDomainIs(host, "www.cibt.com") ||
ASKER CERTIFIED SOLUTION
brutaldev

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros