Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9192127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:50:57+00:00 2026-06-17T20:50:57+00:00

The code below gives me a NullReferenceException was unhandled. Object reference not set to

  • 0

The code below gives me a “NullReferenceException was unhandled. Object reference not set to an instance of an object.” error at RichTextBox1.Text = thepage

What is causing this error?

Could it be an incorrect username and/or password?

Could it be because I receive this message “You have requested an encrypted page that contains some unencrypted information. Information that you see or enter on this page could easily be read by a third party.” when I go to the login webpage in my browser?

Thanks in advance!

Imports System.Net
Imports System.Text
Imports System.IO

Public Class Form1
Dim logincookie As CookieContainer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim postData As String = "__MOID__=1688&__FH__=LoginForm&backUrl=http%3A%2F%2Fwww.reuters.com%2F&backParameterEncoded=false&source=portfolio&trackingSource=&loginName=johnnordeen1%40gmail.com&password=gromit+1&flag=true"
    Dim tempCookies As New CookieContainer
    Dim encoding As New UTF8Encoding
    Dim byteData As Byte() = encoding.GetBytes(postData)

    Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("https://commerce.us.reuters.com/login/pages/login/login.do?backUrl=http%3A%2F%2Fwww.reuters.com%2F&backParameterEncoded=false&source=portfolio&flow=PORTFOLIO&entry_source=registration"), HttpWebRequest)
    postReq.Method = "POST"
    postReq.KeepAlive = True
    postReq.CookieContainer = tempCookies
    postReq.ContentType = "application/x-www-form-urlencoded"
    postReq.Referer = "https://commerce.us.reuters.com/login/pages/login/login.do?backUrl=http%3A%2F%2Fwww.reuters.com%2F&backParameterEncoded=false&source=portfolio&flow=PORTFOLIO&entry_source=registration"
    postReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
    postReq.ContentLength = byteData.Length

    Dim postreqstream As Stream = postReq.GetRequestStream()
    postreqstream.Write(byteData, 0, byteData.Length)
    postreqstream.Close()

    Dim postresponse As HttpWebResponse

    postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
    tempCookies.Add(postresponse.Cookies)
    logincookie = tempCookies
    Dim postreqreader As New StreamReader(postresponse.GetResponseStream())

    Dim thepage As String = postreqreader.ReadToEnd

    RichTextBox1.Text = thepage

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    WebBrowser1.DocumentText = RichTextBox1.Text
End Sub
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:50:58+00:00Added an answer on June 17, 2026 at 8:50 pm

    I’m sure this has nothing to do with security or permissions. What’s the most likely is that your markup does not have a control named “RichTextBox1″ or that it is not getting automatically instantiated as expected. If you break the debugger on that line causing the exception and evaluate RichTextBox1 you should find that it’s null. Double check that your page has a control with ID=”RichTextBox1” and that it is getting instantiated as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below gives the error: error: type ‘std::list<T,std::allocator<_Tp1> >’ is not derived from
The code below gives an error: Property 'Int32 Key' is not defined for type
the code below gives compilation error when I try to create test t[2]; because
The code below gives me the following error: incompatible types when assigning to type'char[10]'
I'm trying to set up a Backbone application. This code below gives to following
how do I convert a reference to a pointer correctly? The code below gives
The code below gives an undefined error on console for the variable mystyle .
The code below gives the following error : Error: C:\Users\Laptop\algs4\hello\Main.java:8: possible loss of precision
The code below gives me error = Subscript indices must either be real positive
The code below gives me the current time. But it does not tell anything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.