|
Don't use on error goto. Use structured exception handling.
And have a google for "log4net" - its a free library for logging, and its excellent.
|
|
|
|
|
I've created a basic User Control with VB.NET that works fine in both a Windows Form and a WEB Page.
I'm using the following code to load the User Control into the WEB Page.
<object id="MyUserControl" classid="http:MyUserControl.dll#MyUserControl.TimerControl"></object>
After I sign the User Control it stops working in the WEB Page but is fine in the Windows Form.
What must I now do to enable the Signed User Control to work in the WEB page?
Regards
Andy Dale
|
|
|
|
|
I have a form which has a button called "Modify Intrest" and when you click it, it brings up a password box and asks for the password. What I wanted was if password was typed in wrong three times, a message to display and then when you click OK, the application to close.
If you type the password in correctly, I want an intrest rate box to display and you have to type in a number and it is written to a file ir.txt
Here is code I have:
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click<br />
<br />
If txtIntrest.Text = ("") Then<br />
MsgBox("Please Enter Intrest Rate", MsgBoxStyle.Exclamation)<br />
Exit Sub<br />
End If<br />
<br />
<br />
If Not txtIntrest.Text.Equals(myline) Then<br />
<br />
<br />
<br />
Static passnum As Integer<br />
Do<br />
Dim pass As String = InputBox("Enter the Password", "Enter Password", "", )<br />
<br />
<br />
If pass = "Password" Then<br />
<br />
Dim intrest As String = InputBox("Enter The New Intrest", "Enter Intrest Rate", "", )<br />
<br />
txtIntrest.Text = (intrest)<br />
<br />
Dim theFile As FileStream = File.Create("ir.txt")<br />
Dim writer As StreamWriter = New StreamWriter(theFile)<br />
writer.WriteLine(txtIntrest.Text)<br />
writer.Close()<br />
theFile.Close()<br />
Exit Sub<br />
Exit Do<br />
Else<br />
Loop Until passnum = 3<br />
passnum = +1<br />
End If<br />
<br />
MsgBox("You have had three attempts to input password, Program will now close for security reasons", MsgBoxStyle.Critical)<br />
Application.Exit()<br />
<br />
<br />
<br />
<br />
<br />
<br />
End If<br />
<br />
End Sub
I messed it up slightly and not sure how to fix it, any ideas?
In the end we're all just the same
|
|
|
|
|
Dave McCool wrote: Loop Until passnum = 3
passnum = +1
End If
You need to show the password dialog again inside this loop and check if it is entered right. This code doesn't allow anyone to try again.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks, but I am not 100% sure how to do this. I took out the code so it looks like this:
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click<br />
<br />
If txtIntrest.Text = ("") Then<br />
MsgBox("Please Enter Intrest Rate", MsgBoxStyle.Exclamation)<br />
Exit Sub<br />
End If<br />
<br />
<br />
If Not txtIntrest.Text.Equals(myline) Then<br />
<br />
Dim pass As String = InputBox("Enter the Password", "Enter Password", "", )<br />
<br />
<br />
If pass = "Password" Then<br />
<br />
Dim intrest As String = InputBox("Enter The New Intrest", "Enter Intrest Rate", "", )<br />
<br />
txtIntrest.Text = (intrest)<br />
<br />
Dim theFile As FileStream = File.Create("ir.txt")<br />
Dim writer As StreamWriter = New StreamWriter(theFile)<br />
writer.WriteLine(txtIntrest.Text)<br />
writer.Close()<br />
theFile.Close()<br />
Exit Sub<br />
<br />
End If<br />
<br />
End If<br />
<br />
End Sub
So the password box just closes when the wrong password is input. I want the password box to keep displaying istead of closing and if you type password wrong three times, this code to execute:
MsgBox("You have had three attempts to input password, Program will now close for security reasons", MsgBoxStyle.Critical)<br />
Application.Exit()
but I was told I could do this with a loop, but was not sure how I had code:
Static passnum As Integer<br />
Do<br />
<br />
passnum = +1<br />
Loop Until passnum = 3
but was not sure where to put it so it worked, any ideas?
In the end we're all just the same
|
|
|
|
|
What code can I use to end a VB 6.0 program from the same program or another program?
|
|
|
|
|
From the same program, see http://www.mvps.org/vbvision/visual_basic_tips.htm[^]
From another program you have to send a WM_CLOSE message to the application main window.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I am exporting a dataset to Excel.
I can successfully view the dataset in Excel however, there are
special characters that are appearing in the form of Â, â€" and
others.
My code in VB starts off like this:
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition",
"attachment;filename=GeneralInquiry.xls")
I've tried setting the Response.Charset = "" but that doesn't do
anything either.
Would anyone know what could be causing this and/or how to fix it?
Thank you.
|
|
|
|
|
Is it in ASP.NET ?
Try using HtmlEncode and HtmlDecode ? This solved my problem for hyphen character.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Please read the forum guidelines. Do not use urgent in your message titles.
|
|
|
|
|
Please don't use words like urgent. It is consider very rude around here.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi forum,
i like to implement my own DataTypes.
Sample:
DIM X as PARTNUMBER
DIM Y as LIST (OF PARTNUMBER) .....
where PARTNUMBER is my own Datatype with special checks, like PARTNUMBER must have 8 digits, first DIGIT must be character etc.
I like to use this own datatypes in the same way as the base types STRING, INTEGER, .....
Questions:
1) Implementation as CLASS or STRUCTURE ?
2) Which interfaces are necessary ?
3) Any samples available ?
regards,
bauer
|
|
|
|
|
Problem solved, using TypeConverter is the solution.
|
|
|
|
|
How to read an XML file, Which is stored as a resource file in a dll using VB 6.0.
DS
|
|
|
|
|
There should be plenty on a google search for this topic.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Dear Sir/Mam,
I have 1 question regarding xml file verification in vb
I have 1 application to create a .xml file in vb but after creating
this file I want to check whether is it in correct format or not?
& show to user whether error occured in that file.
In that I have not a xml schema.
How can I do it?
In advance Thanx
Have a nice time
|
|
|
|
|
kripa ostwal wrote: I want to check whether is it in correct format or not?
& show to user whether error occured in that file.
In that I have not a xml schema.
What do you mean by 'correct'? That the file is well-formed, or that the data structure adheres to your expectations?
Attempting to parse the XML file will determine whether it is well-formed. Checking that the data structure adheres to your expectations will be difficult if you don't have a schema to validate the document against.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Sir I just want to check that
Is it in well formed or not? &
If is not in well formed just display where is error?
Hope I will get answer.
Thanking in advance
|
|
|
|
|
Hello,
I got to link my VB.net application to Microsoft Outlook 2000. I have to file/save email messages from inbox to public folders and extract message and attachments to update in database. I am new to Outlook programming, can anyone guide for following issues:
- Can I write Office COM Addin in VB 2005 for Outlook 2000 or I have to use VB6 or macros.
- What information I need to save in database in order to track email message back in exchange server's public folders.
I will appreciate for your help.
Nas
|
|
|
|
|
hi
i work on a project that need to rasterize svg files...
i search the web but can't find any source code or activex for doing this.
anyone can help me ?
also is there a way that show SVG file in browser without plugin installed ?
thanx
|
|
|
|
|
mehdi0016 wrote: also is there a way that show SVG file in browser without plugin installed ?
Obviously not, unless it's a browser that has the plugin by default.
I think the best way would be to capture the screen of a browser that's rendering the SVG.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i need a commandline converter or dll to work in server side, without showing svg and capture the screen...
|
|
|
|
|
I am trying to copy a working .rpt file, then make a slight change.
Studio keeps giving me an error in the .vb file. I renamed the classname to a unique name.
Public Class CasesReportByStatus
Inherits ReportClass <---- squiggly underlines here
Error 1 Base class 'CrystalDecisions.CrystalReports.Engine.ReportClass' specified for class 'CasesReportByStatus' cannot be different from the base class 'System.Web.UI.Page' of one of its other partial types.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
Is this a web project? I had a similar error and corrected it by moving the code to either App Code or a dll library.
If that doesn't help or doesn't fit have you tried creating a new report from the designer and then choose by template, and picking other report?
Crystal is not so much about understanding why as it is doing the same things over and over again until it works.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I'm trying to evaluate the SelectedValue property but it's Nothing in the immediate window. If I put an if statement in and check for nothing it doesn't work. I've tried
.SelectedValue <> Nothing
Not cbo.SelectedValue is Nothing
etc etc etc
Help Please!
|
|
|
|