|
Write some code to do it?
Try searching Google, MSDN or this site - you'll find plenty of info.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Razanust wrote: displays it to the user one after another
Normally MCQ based quiz are not in sequence they are Random.
Razanust wrote: How can this be done?
at what stage are you. what is the difficulty / Problem you are having
SOFTDEV
If you have knowledge, let others light their candles at it. [ Let's work to help developers, not make them feel stupid ]
|
|
|
|
|
I am a beginner to it.
Well the problem i am facing is that i can't find a proper procedure of how to link the questions with the help of databases to the VB Form.
That is if i want the label's text to be same as the variable say 'Question1' i would write text.label1= Question1
Now i want this thing to do with Access Database Files.
Any reference Article or sample code would be quite helpful.
|
|
|
|
|
|
There are lots of good articles here on CodeProject. Maybe this[^] will interest you.
|
|
|
|
|
I suggest you also have a look here[^].
|
|
|
|
|
Thanks to all for your help.
I found another good video at http://vimeo.com/8618838.
|
|
|
|
|
Hi all,
I'm using the unrar.dll and the decompressor-class.
I use a rar-file for extraction with:
Dim d As New Decompressor("filename")
d.UnPackAll("path")
After extraction I wan't to delete the rar-file by code, but I get
the message that the file is allready in use.
I can't find a process in task manager which I can delete.
And there is not event like "d.Dispose()" or "d.Close", "d = Nothing" didn't help too.
How can I set the file free for deleting?
Thanks all for help
br Maik
|
|
|
|
|
The process that's holding the file open is most likely your own. Apparently, that library holds the file open for the life of the Decompressor object. Your best source of information would be the people who wrote that library.
|
|
|
|
|
you could look at the documentation, and/or use Reflector, to discover some method that closes the input file; it might be called Close() . If all else fails, look for a Dispose() method.
|
|
|
|
|
In VB6, it seems that the max height of a PictureBox or any other control is 245745.
Is there any way to extend the height of the PictureBox?
Thanks,
Bob
|
|
|
|
|
Nope. You'd have to create you own from scratch.
The bigger question is why would you be displaying an image that large since there's no display in the world capable of showing it all?
|
|
|
|
|
Maybe he is trying to rotate this[^] sideways?
|
|
|
|
|
Do you know how I could develop my own? all I need is a container for other controls. Is ther an API that would let me build a container of any height I need?
Bob
|
|
|
|
|
I don't know myself since I haven't touched VB6 in the last 9 years (even since I got my hands on the (VB.NET/.NET 1.0 Beta back around '01).
In VB.NET, it's a piece of cake. You cannot use VB.NET examples to do it in VB6 since VB6 doesn't support OOP nor the classes found in the .NET Framework.
And in the email that you sent me (I normally don't anwer them), the solution is not to make such a huge control. You don't need one that size. You just need to render on screen what is visible at the time.
|
|
|
|
|
could someone help me change the sound card (if installed more than one) using winmm.dll?
|
|
|
|
|
Don't cross post the same question in multiple forums.
This has nothing to do with either C# or VB.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If I posted in two forums is because I need help and language independent, any suggestion would be valid.
... the worst stupidity is not one that allows us to see!
|
|
|
|
|
FlavioAR wrote: If I posted in two forums is because I need help and language independent, any suggestion would be valid.
By that logic you could argue that you should have posted in every language forum.
Except that each forum is for language specific questions.
Adding that condition you could argue that you should not have posted in any language forum.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
I'm by no means an expert but I would like to format the following text that I'm pulling from a MySQL database.
'From C:\e-mail\daily-totals.csv
"ReceivedAt","External","Hit_Count","Port" "2010-03-31 00:28:56","92.47.196.147","868","445" "2010-03-31 09:27:29","98.104.149.153","12","135" "2010-03-31 10:08:56","87.237.140.163","12","5900" "2010-03-31 02:49:33","221.195.73.86","12","8000" "2010-03-31 04:22:26","59.53.88.70","8","2967
I have a bash script running a select statement to pull syslog data from a mysql database but I would like to format it in HTML or make it e-mail friendly I'm using the following base code from a Microsoft link to e-mail a daily list of denies from a .csv file.
'--------------------------------------------------------------------
'
' Mailout using CDONTS.NewMail
'
'--------------------------------------------------------------------
' Declare all variables.
Option Explicit
Dim objSendMail
Dim strTo, strFrom
Dim strSubject, strBody
' Mail constants (some are for reference).
Const CdoBodyFormatHTML = 0 ' Body property is HTML
Const CdoBodyFormatText = 1 ' Body property is plain text (default)
Const CdoMailFormatMime = 0 ' NewMail object is in MIME format
Const CdoMailFormatText = 1 ' NewMail object is plain text (default)
Const CdoLow = 0 ' Low importance
Const CdoNormal = 1 ' Normal importance (default)
Const CdoHigh = 2 ' High importance
strFrom = "MySQL@test.com" ' Change to your e-mail address.
strTo = "test@gmail.com" ' Change to the recipient address.
strSubject = "Total Report" ' Change to your subject.
' This line calls the ReadFile() function to read the page contents.
strBody = ReadFile("C:\e-mail\daily-totals.csv")
' This line calls the MakePage() function to format the page as HTML.
strBody = MakePage(strSubject,strBody)
' The following section creates the mail object and sends the mail.
Set objSendMail = CreateObject("CDONTS.NewMail")
objSendMail.From = strFrom
objSendMail.To = strTo
objSendMail.Subject = strSubject & " (" & Date() & ")"
objSendMail.Body = strBody
objSendMail.BodyFormat = CdoBodyFormatHTML
objSendMail.MailFormat = CdoMailFormatMime
objSendMail.Importance = CdoNormal
objSendMail.Send
Set objSendMail = Nothing
' This function returns a properly formatted HTML page.
Function MakePage(txtSubject, txtBody)
Dim txtTemp
txtTemp = "<HTML>" & vbCrLf
txtTemp = txtTemp & "<HEAD><TITLE>"
txtTemp = txtTemp & txtSubject
txtTemp = txtTemp & "</TITLE></HEAD>" & vbCrLf
txtTemp = txtTemp & "<BODY>" & vbCrLf
txtTemp = txtTemp & "<H2>" & txtSubject & "</H2>" & vbCrLf
txtTemp = txtTemp & txtBody & vbCrLf
txtTemp = txtTemp & "</BODY>" & vbCrLf
txtTemp = txtTemp & "</HTML>"
MakePage = txtTemp
End Function
' This function opens a file and returns the contents of the file.
Function ReadFile(txtFile)
Dim txtTemp, objFS, objFL
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFL = objFS.OpenTextFile(txtFile)
Do While Not objFL.AtEndOfStream
txtTemp = txtTemp & objFL.ReadLine
txtTemp = txtTemp & vbCrLf
Loop
objFL.Close
Set objFS = Nothing
ReadFile = txtTemp
End Function
Is there a way to alter the strbody during the "Function ReadFile(txtFile)" command to alter the .csv file to something that would look a little more pretty inside of an e-mail?
Any help would be much appreciated....
If anyone would like to know how I'm getting Cisco Syslog data into a MySQL database I would be willing to enlighten you. I thought is was a somewhat cool process. I would rather take the Syslog data and write it to a MS SQL database if anyone has any idea's or links.
-lo
modified on Friday, April 2, 2010 12:08 AM
|
|
|
|
|
Hi,
1.
your code would be easier to read when presented inside PRE tags (instead of CODE tags); you could still edit your existing post.
2.
this looks like VB, not VB.NET; are you sure you want to use an ancient and obsolete language? converting it to VB.NET wouldn't take much effort and make implementing the new functionality a lot easier.
3.
you should decide for yourself how fancy a result you want.
Here are some possibilities:
- put all the body text in PRE tags, that would automatically result in a non-proportional font and somewhat more of a tabular look;
- or create a real table, using TABLE, TR and TD tags
4.
your ReadFile function is reading a text file line by line and concatenating all; your HTML formatting would probably need the individual lines, so you would have to break it up again, unless you:
- either merge the reading and the formatting code in one function;
- or have ReadFile return a list of text lines.
5.
In order to generate a perfect table, your code would have to split each text line into its fields, as indicated by your header line. That would require locating some comma's and spaces (outside quoted strings only). Not hard at all.
6.
the easiest first step would be changing
txtTemp = txtTemp & txtBody & vbCrLf
to
txtTemp = txtTemp & "<PRE>" & txtBody & "</PRE>" & vbCrLf
which adds the PRE tags.
|
|
|
|
|
Wow.. one line of code... crazy!
"ReceivedAt","External","Hit_Count","Port"
"2010-04-01 00:02:36","211.119.148.217","820","445"
"2010-04-01 00:59:30","221.195.73.86","16","1080"
"2010-04-01 09:49:17","98.105.130.138","14","135"
"2010-04-01 00:59:19","221.195.73.86","14","8000"
"2010-04-01 01:19:57","61.233.103.34","6","1434"
"your ReadFile function is reading a text file line by line and concatenating all; your HTML formatting would probably need the individual lines, so you would have to break it up again, unless you:
- either merge the reading and the formatting code in one function;
- or have ReadFile return a list of text lines."
Not hard for you but very hard for me I know the basics.. I wouldn't even know how to convert the code to a newer .NET version. Would I use Visual Studio?
-lo
|
|
|
|
|
lodogg wrote: Would I use Visual Studio?
Yes, that would be wise.
If you barely know VB, changing to VB.NET is not just an upgrade, the language has evolved and it now uses classes for everything, not just for GUI stuff. I would switch if the code is getting a new lease on life.
You could always outsource.
|
|
|
|
|
I would rather stay with my current old dilapidated code and rewrite it in the future. This is a home system and I outsource implementations all of the time at work but not for a home project.. Any Ideas on how I can format the output into an HTML format?
I take it I would alter code under the
Function ReadFile(txtFile)
I would like to put each item in a column:
"ReceivedAt", "External", "Hit_Count", "Port"
"2010-03-31 00:28:56", "92.47.196.147", "868", "445"
Thanks for all of the responses!!
-lo
|
|
|
|
|
Here is one possibility for formatting the output:
When emitting this HTML code:
<table border='1'>
<tr align='center'><td><strong>title1</strong></td><td><strong>title2</strong></td><td><strong>title3</strong></td><td><strong>title4</strong></tf></tr>
<tr align='right'><td>value11</td><td>value12</td><td>value13</td><td>value14</td></tr>
<tr align='right'><td>value21</td><td>longvalue22</td><td>value23</td><td>value24</td></tr>
<tr align='right'><td>value91</td><td>value92</td><td>longvalue93</td><td>value94</td></tr>
</table>
the result, when looked at with a web browser, could be this (but many variations are possible, either by adding HTML tags, or, better yet, by defining some CSS styles):
title1 | title2 | title3 | title4 | value11 | value12 | value13 | value14 | value21 | longvalue22 | value23 | value24 | value91 | value92 | longvalue93 | value94 |
Whatever you want, the first job of course is to split the input lines in their fields ("valueXY" in my example).
|
|
|
|