Is It Possible?

  • Thread starter Chris Calzaretta
  • Start date
C

Chris Calzaretta

From: "Chris Calzaretta" <[email protected]>
Subject: Re: Is It Possible?
Date: Friday, February 04, 2005 11:44 AM

Ok i am posting the code
I need to create a form from this web service
http://24.163.239.122/wsprojecttrackerobjects/wsprojecttrackerobjects.asmx
if you call getloginscreen there is a field called screendecription
that field screendecription has the form code I am trying to create at
runtime

the code that is in the field screendecription is
Imports System.Windows.Forms
Public Class clsLoginScreen
Inherits System.Windows.Forms.Form
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If

MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents NicePanel1 As PureComponents.NicePanel.NicePanel
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Dim ContainerImage1 As PureComponents.NicePanel.ContainerImage = New
PureComponents.NicePanel.ContainerImage
Dim HeaderImage1 As PureComponents.NicePanel.HeaderImage = New
PureComponents.NicePanel.HeaderImage
Dim HeaderImage2 As PureComponents.NicePanel.HeaderImage = New
PureComponents.NicePanel.HeaderImage
Dim PanelStyle1 As PureComponents.NicePanel.PanelStyle = New
PureComponents.NicePanel.PanelStyle
Dim ContainerStyle1 As PureComponents.NicePanel.ContainerStyle = New
PureComponents.NicePanel.ContainerStyle
Dim PanelHeaderStyle1 As PureComponents.NicePanel.PanelHeaderStyle = New
PureComponents.NicePanel.PanelHeaderStyle
Dim PanelHeaderStyle2 As PureComponents.NicePanel.PanelHeaderStyle = New
PureComponents.NicePanel.PanelHeaderStyle
Me.NicePanel1 = New PureComponents.NicePanel.NicePanel
Me.SuspendLayout()
Me.NicePanel1.BackColor = System.Drawing.Color.Transparent
ContainerImage1.Alignment = System.Drawing.ContentAlignment.BottomRight
ContainerImage1.ClipArt = PureComponents.NicePanel.ImageClipArt.None
ContainerImage1.Image = Nothing
ContainerImage1.Size = PureComponents.NicePanel.ContainerImageSize.Small
ContainerImage1.Transparency = 50
Me.NicePanel1.ContainerImage = ContainerImage1
HeaderImage1.ClipArt = PureComponents.NicePanel.ImageClipArt.None
HeaderImage1.Image = Nothing
Me.NicePanel1.FooterImage = HeaderImage1
Me.NicePanel1.FooterText = "PureComponents NicePanel for .NET WinForms
V1.0."
Me.NicePanel1.ForeColor = System.Drawing.Color.Black
HeaderImage2.ClipArt =
PureComponents.NicePanel.ImageClipArt.PureComponents
HeaderImage2.Image = Nothing
Me.NicePanel1.HeaderImage = HeaderImage2
Me.NicePanel1.HeaderText = "NicePanel1"
Me.NicePanel1.IsExpanded = True
Me.NicePanel1.Location = New System.Drawing.Point(0, 0)
Me.NicePanel1.Name = "NicePanel1"
Me.NicePanel1.OriginalFooterVisible = True
Me.NicePanel1.OriginalHeight = 0
Me.NicePanel1.Size = New System.Drawing.Size(400, 264)
ContainerStyle1.BackColor = System.Drawing.Color.FromArgb(CType(142,
Byte), CType(179, Byte), CType(231, Byte))
ContainerStyle1.BaseColor = System.Drawing.Color.Transparent
ContainerStyle1.BorderColor = System.Drawing.Color.FromArgb(CType(1,
Byte), CType(45, Byte), CType(150, Byte))
ContainerStyle1.BorderStyle = PureComponents.NicePanel.BorderStyle.Solid
ContainerStyle1.CaptionAlign = PureComponents.NicePanel.CaptionAlign.Left
ContainerStyle1.FadeColor = System.Drawing.Color.FromArgb(CType(217,
Byte), CType(232, Byte), CType(252, Byte))
ContainerStyle1.FillStyle =
PureComponents.NicePanel.FillStyle.DiagonalForward
ContainerStyle1.FlashItemBackColor = System.Drawing.Color.Red
ContainerStyle1.FocusItemBackColor =
System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(128,
Byte))
ContainerStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif",
8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))
ContainerStyle1.ForeColor = System.Drawing.Color.Black
ContainerStyle1.Shape = PureComponents.NicePanel.Shape.Squared
PanelStyle1.ContainerStyle = ContainerStyle1
PanelHeaderStyle1.BackColor = System.Drawing.Color.FromArgb(CType(9,
Byte), CType(42, Byte), CType(127, Byte))
PanelHeaderStyle1.ButtonColor = System.Drawing.Color.FromArgb(CType(172,
Byte), CType(191, Byte), CType(227, Byte))
PanelHeaderStyle1.FadeColor = System.Drawing.Color.FromArgb(CType(102,
Byte), CType(145, Byte), CType(215, Byte))
PanelHeaderStyle1.FillStyle =
PureComponents.NicePanel.FillStyle.HorizontalFading
PanelHeaderStyle1.FlashBackColor =
System.Drawing.Color.FromArgb(CType(243, Byte), CType(122, Byte), CType(1,
Byte))
PanelHeaderStyle1.FlashFadeColor =
System.Drawing.Color.FromArgb(CType(255, Byte), CType(215, Byte), CType(159,
Byte))
PanelHeaderStyle1.FlashForeColor = System.Drawing.Color.White
PanelHeaderStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif",
8.25!)
PanelHeaderStyle1.ForeColor = System.Drawing.Color.FromArgb(CType(169,
Byte), CType(198, Byte), CType(237, Byte))
PanelHeaderStyle1.Size = PureComponents.NicePanel.PanelHeaderSize.Small
PanelStyle1.FooterStyle = PanelHeaderStyle1
PanelHeaderStyle2.BackColor = System.Drawing.Color.FromArgb(CType(102,
Byte), CType(145, Byte), CType(215, Byte))
PanelHeaderStyle2.ButtonColor = System.Drawing.Color.FromArgb(CType(172,
Byte), CType(191, Byte), CType(227, Byte))
PanelHeaderStyle2.FadeColor = System.Drawing.Color.FromArgb(CType(9,
Byte), CType(42, Byte), CType(127, Byte))
PanelHeaderStyle2.FillStyle =
PureComponents.NicePanel.FillStyle.VerticalFading
PanelHeaderStyle2.FlashBackColor =
System.Drawing.Color.FromArgb(CType(243, Byte), CType(122, Byte), CType(1,
Byte))
PanelHeaderStyle2.FlashFadeColor =
System.Drawing.Color.FromArgb(CType(255, Byte), CType(215, Byte), CType(159,
Byte))
PanelHeaderStyle2.FlashForeColor = System.Drawing.Color.White
PanelHeaderStyle2.Font = New System.Drawing.Font("Microsoft Sans Serif",
9.75!, System.Drawing.FontStyle.Bold)
PanelHeaderStyle2.ForeColor = System.Drawing.Color.FromArgb(CType(215,
Byte), CType(230, Byte), CType(251, Byte))
PanelHeaderStyle2.Size = PureComponents.NicePanel.PanelHeaderSize.Medium
PanelStyle1.HeaderStyle = PanelHeaderStyle2
Me.NicePanel1.Style = PanelStyle1
Me.NicePanel1.TabIndex = 0
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(400, 273)
Me.Controls.Add(Me.NicePanel1)
Me.Name = "clsLoginScreen"
Me.Text = "clsLoginScreen"
Me.ResumeLayout(False)
End Sub
Private Sub clsLoginScreen_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub End Class

So that is the code that is being pulled out of the database
It is just a plain form with a nicepanel on it. Which intails need the
nicepanel assembly added.

Here is my code I am using to try to get the form to comile at run time
I make a direct call to the database rather then hitting the web service in
the code below.

Dim cn As OleDbConnection
Dim sConnString As String = _
"Provider=SQLOLEDB;server=vsdev;UID=sa;PWD=sa;database=projecttracker"
cn = New OleDb.OleDbConnection(sConnString)
Dim ds As New DataSet
Dim cm As New OleDbCommand("select * from tblscreen", cn)
Dim a As New OleDbDataAdapter(cm)
cn.Open()
a.Fill(ds)
cn.Close()
Dim provider As Microsoft.VisualBasic.VBCodeProvider
Dim compiler As System.CodeDom.Compiler.ICodeCompiler
Dim params As System.CodeDom.Compiler.CompilerParameters
Dim results As System.CodeDom.Compiler.CompilerResults
Dim scriptType As Type
Dim instance As Object
Dim rslt As Object
params = New System.CodeDom.Compiler.CompilerParameters
params.GenerateInMemory = True 'Assembly is created in memory
params.TreatWarningsAsErrors = False
params.WarningLevel = 4
'Put any references you need here - even you own dll's, if you want
to use one
Dim refs() As String = {"System.IO", "System.dll",
"Microsoft.VisualBasic.dll", "PureComponents.NicePanel.NicePanel",
"System.Windows.Forms"}
params.ReferencedAssemblies.AddRange(refs)

provider = New Microsoft.VisualBasic.VBCodeProvider
compiler = provider.CreateCompiler
Try
results = compiler.CompileAssemblyFromSource(params,
ds.Tables(0).Rows(0).Item("screendescription").ToString)
Catch ex As Exception

End Try
If results.Errors.Count = 0 Then 'No compile errors or
warnings...
mAssembly = results.CompiledAssembly
End If
'Get the type from the assembly. This will allow us access to
'all the properties and methods
Dim err As System.CodeDom.Compiler.CompilerError
For Each err In results.Errors
MsgBox(String.Format( _
"Line {0}, Col {1}: Error {2} - {3}", _
err.Line, err.Column, err.ErrorNumber, err.ErrorText))
Next
scriptType = mAssembly.GetType("clsScreens.clsLoginScreen")

'Set up an array of objects to pass as arguments.
Dim args() As Object = {""}

'And call the static function
rslt = scriptType.InvokeMember("StaticFunction", _
System.Reflection.BindingFlags.InvokeMethod Or _
System.Reflection.BindingFlags.Public Or _
System.Reflection.BindingFlags.Static, _
Nothing, Nothing, args)


So as you can see I pull the form out of the database. It is a windows form.
But I think that I missing some stuff. When you create a form you get a .vb
filr and a ..resx file which i am not createing.
I did not think that you needed to create that file.

If you have any thoughts please let me know


Thank you
CC
 
G

Guest

The domain name: 24.163.239.122 is registered with Road Runner (resolves to
CPE-24-163-239-122.mn.rr.com). Now, I know from experience with fighting SPAM
that this domain is used for SPAMMING

After doing a few seconds research this IP address is in a SPAM real-time
blocking list. My advice to anyone is not to click on that link from the
original post

Here is the address details of Road Runner:

OrgName: Road Runner
OrgID: RRMA
Address: 13241 Woodland Park Road
City: Herndon
StateProv: VA
PostalCode: 20171
Country: US
Phone: +1-703-345-3416

You have been warned!!!!!!!!!!!!!!
 
H

Herfried K. Wagner [MVP]

Crouchie1998 said:
Here is the address details of Road Runner:

[Address snipped]

I always thought that its "forbidden" to post WHIOS details in the public.
 
G

Guest

Mr MVP,

Are you stalking me? Nice to know you are putting your two-cents in AGAIN

I never knew that whois info is banned in these forums. Where is it written
that its banned?

SPAMMERS look through these forums to try to get e-mail addresses. If the IP
address was ok then why was it in number format?

As I also said, that address is on a real-time SPAM blocking list. Anyone
who clicks that link will probably be added to a SPAM database.

I enjoy fighting SPAM (reversing it) & getting them blocked. If everyone
reported SPAM as I do then no one would get SPAM.

If you report the SPAMMERS like I do, they remove you from their SPAMMING
lists because they don't want their MX's blocked, do they? No, because they
cannot continue to SPAM anyone that way.
 
H

Herfried K. Wagner [MVP]

Crouchie1998 said:
I never knew that whois info is banned in these forums. Where is it
written
that its banned?

I never said that it's banned. I only remember that some WHOIS databases
include a text that says that the information returned by the query should
not be made available in the public (even if it's registration data of
spammers' domains).
 

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