|
OK. Since the ThreadPool threads are completely encapsulated and insulated from your code, have fun with it!
|
|
|
|
|
|
Hi,
ThreadPool threads have their limitations, threads have a IsThreadPoolThread property, and when true, there are a couple of things you can't do. if you're not happy with it, use something else:
- BackgroundWorker;
- regular Threads.
The best article ever on threads is here[^].
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I have a project in vb.net2008. Having Forms only 8 and 2 classes and 1 module, and 1 Splash screen
& 1 crystal report ..
From the 8 forms, 4 forms I used Data Gridview class object & 3 forms Crystal report 1 for screen design.
But it's showing the memory size for whole project 417-MB, is it true? Is it nature of vb.net 2008?
Or I have virus?
And Publish-setup.exe is 452 kb only...
Is it normal behavior? or virus?
Thanks
|
|
|
|
|
It's just a Visual Studio thing.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Dear VBscript experts,
I have the following requirement which can be done in VB script . I am new to this forum and
am sure i will learn a lot by your valuable hints .
requirements are
- the log file should be deleted if the files are older than 400 days
- the log files from the server should be kept in the backup folder for 185 days.
Script should check the following:
1. Check if a file c:\\emailmoniroing\\logs\EmailLogyymmdd.log exists where ‘yymmdd’ denotes today’s date If it does
not, create a new file.
2. For each file in the ‘c:\\emailmonitor\main’ folder, check file size.
3. If file size=0, then move the file from the 'c:\\Emailmonitoring\main' folder to the ‘ c:\\emailmonitoring\backup’
folder
4. If file size >0, then read/append contents of the file to c:\emailmonitor\logs\EmailLogyymmdd.log. Move the file
read from the
'c:\\Emailmonitoring\main' folder to the ‘ c:\\emailmonitoring\backup’ folder
5. Delete all files older than 'x'' months from the c:\\emailmonitoring\backup folder
6. Delete all EmailLogyymmdd.log files older than ‘x’ months from the folder ‘c:\\emailmonitoring\Logs’
Finally,
Set up a windows scheduler task to run the new script every 20 minutes or it can run continuously, sleep and wake up
every 5 minutes
Could you provide any sample script something to acheive the above. it will be very useful to meet our business needs.
Thanks in advance
regards
pannar
|
|
|
|
|
Option Explicit
' Variable declaritions
Dim fso, f, f1, fc,sf
Dim colSubfolders
Dim objSubfolder
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("C:\poetic\logs\Emailmonitoring")
Set fc = f.Files
Set colSubfolders = f.Subfolders
For Each objSubfolder in colSubfolders
'Wscript.Echo objSubfolder.Name, objSubfolder.Size
If((objSubfolder.Name = "backup") Or (objSubfolder.Name = "logs"))Then
Set sf = objSubfolder.Files
'log files under backup folder should be deleted if the files are older than 400 days
For Each f1 in sf
If DateDiff("d", f1.DateLastModified, Now) > 1 Then
f1.Delete
End If
Next
End If
Next
Set colSubfolders = Nothing
Set sf = Nothing
Set fso = Nothing
Set f = Nothing
Set fc = Nothing
|
|
|
|
|
Hi All,
How can i rotate Label to 90° Angle.
Thanks
If you can think then I Can.
|
|
|
|
|
|
Here is an article on codeproject with another good control to do this <a href="http://www.codeproject.com/KB/miscctrl/customtext.aspx">Customized Text - Orientated Controls in C# - Part I (Label Control)</a>[<a href="http://www.codeproject.com/KB/miscctrl/customtext.aspx" target="_blank" title="New Window">^</a>]
I know it is c# but it could easily be translated into VB.NET using <a href="http://www.icsharpcode.net/OpenSource/SD/">Sharp Develop</a>[<a href="http://www.icsharpcode.net/OpenSource/SD/" target="_blank" title="New Window">^</a>] or similar.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hi,
I had also tried with following code but gives an error
rss.Open("select max(orderno) As ono from measurementblazer where custno='" & txtcustno.Text & "' AND blength<>0 ")
o.order_no = rss.Fields("orderno").Value // here comes an error
//Item cannot be found in the collection corresponding to the requested name or ordinal.//
This error comes because in table there is no record found for requested customer.
Please help.
Thanks,
|
|
|
|
|
Try this: o.order_no = rss.Fields("ono").Value
You named the field 'ono' in your query: ...select max(orderno) As ono from...
Tosch
|
|
|
|
|
Hi,
I am trying with the same code but there is same error
Thanks,
|
|
|
|
|
AjitMourya wrote: o.order_no = rss.Fields("orderno").Value // here comes an error
Why not check first if you got a result ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Answered in this forum, in this[^] thread, just a few hours ago.
..and yes, I have verified whether the query works in Access
|
|
|
|
|
Hi Experts ,
I want the code or solution to suppress the strings(-) in crystal report.
There is functionality to suppress zero.
Thanks,
|
|
|
|
|
You can suppress a text field by checking the suppress box in the format editor of a textbox.
Tosch
|
|
|
|
|
I am new to VB 2008, and I am learning this new language VB. The project I started to write a small program Calculator that will do just like a real calculator on (Windows XP).
I ran in some problems when I am trying to write routine to accept "/" divide, "+" plus, and "-" minus from right side of the keyboard. with press NUMLOCK ON. When I press NUMLOCK ON, the program should accept the "/", "*", "-", "+" and perform arithmetic.
My program calculator now can accept "/", "*", "-" when I used the mouse to press buttons on the calculator's interface.
Can someone tell me what the code will be? I am stuck...and I need help..
how to write the routine that will accept the operand to perform the basic arithmetic
thanks for everyone can help!!
Andy
|
|
|
|
|
Handle the form's KeyPress[^] event. KeyEventArgs.KeyCode gives you the current key which is pressed.
|
|
|
|
|
From the KeyDown Event, you can check
if e.KeyCode =Keys.NumLock or e.keycode=Keys.NumPad0 or...whatever else as per the need.
|
|
|
|
|
I am using four timers and I think I need to use each one on a different thread.
I am somewhat new to VB. I have learned a lot in the last 10 months.
I just need someone to show me how to use threads w/timers. PLZ post some small
coding on how todo this.
Thanks in advance for everybodies help.
rspercy
If "You wash your feet and find a pair of socks " Then
"You ARE a Redneck"
End If
|
|
|
|
|
There are two types of timers available in .NET framework
1 - System.Threading.Timer[^]
2 - System.Windows.Forms.Timer[^]
The first timer runs a methods on a thread pool thread and the second one runs the method on the same thread. Second one is used with windows forms.
rspercy60 wrote: I am using four timers and I think I need to use each one on a different thread.
What type of timer are you using? You need to tell use, why you think each one should be executed on a different thread?
rspercy60 wrote: I just need someone to show me how to use threads w/timers. PLZ post some small
Looks at the MSDN documentation which I linked to see how timer is used. For threading, this[^] would be the excellent material available on-line.
|
|
|
|
|
I am using System.Windows.Forms.Timers. I have three controls, each control has to be activated
at the same time. Here is one timers code.
Private Sub TMPTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TMPTimer.Tick
If oldTemp < newTemp Then
oldTemp += 1
DirectCast((Me.BaseUI1.Frame(0)), CircularFrame).ScaleCollection(0).Pointer(0).Value = oldTemp
If oldTemp = newTemp Then
oldTemp = newTemp
DirectCast(Me.BaseUI1.Frame(0).FrameCollection(0), NumericalFrame).Indicator.DisplayValue = oldTemp.ToString() & "°"
TMPTimer.Enabled = False
End If
End If
If oldTemp > newTemp Then
oldTemp -= 1
DirectCast((Me.BaseUI1.Frame(0)), CircularFrame).ScaleCollection(0).Pointer(0).Value = oldTemp
If oldTemp = newTemp Then
oldTemp = newTemp
DirectCast(Me.BaseUI1.Frame(0).FrameCollection(0), NumericalFrame).Indicator.DisplayValue = oldTemp.ToString() & "°"
TMPTimer.Enabled = False
End If
End If
End Sub
This code is for a temperature guage, I have two other guages for wind direction and wind speed and all have to be activated at the same time. This is why I think I need threeds
rspercy
If "You wash your feet and find a pair of socks " Then
"You ARE a Redneck"
End If
|
|
|
|
|
I take it you need them all activated because you want the three incoming values to be taken at exact the same time?
If you make all four measurements in a single timer's tick event, they will be received within less than a millisecond of each other (depending on your computer ofcourse).
If you create four threads, they will each be activated from the main thread, within less than a millisecond from each other (depending on your computer ofcourse).
See where I am going with this?
My advice is free, and you may get what you paid for.
|
|
|
|
|
THNX a lot. Worked great. I added all into 1 timer, fantastic.
rspercy
If "You wash your feet and find a pair of socks " Then
"You ARE a Redneck"
End If
|
|
|
|