Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net 2008 Setting References 1

Status
Not open for further replies.

Christineeve

Programmer
Feb 12, 2005
104
0
0
US
I'm sorry to be asking the stupidest question today. But, I'm trying to set some references and I'm having difficulty.

Back in the good old days of VB 6, it was easy to set a reference. But now, I'm having problems with .Net.

How do you set a reference to Scripting? I see it set in my example project. But, I'm trying to set it in my project and I can't find it or how to do it.

I have added my other references, the scripting reference is eluding me...
 
In your project's solution explorer right click on the project name and select 'Add Reference' then add it.
 
I have added my other references, the scripting reference is eluding me... "

The problem is I can't find the Scripting reference.
 
Once you have selected Add Reference, select the COM tab and then scroll down to Microsoft Script Control 1.0 and select that.

An example of how to use it .....

The file TextFile1.txt contains:
Code:
Sub Main
  MsgBox "This is a test Script"
End Sub


The form is just:
Code:
Imports MSScriptControl

Public Class Form1

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

    Dim sc As ScriptControl = New ScriptControl
    sc.Language = "VBScript"
    sc.AddCode(My.Computer.FileSystem.ReadAllText("TextFile1.txt"))
    sc.Run("main")

  End Sub
End Class


Hope this helps
 
Hi,
Thank you for guiding me to the reference so that my code works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top