|
Hi one thing I've found really useful is to not use words such as Date, Time, etc the VB uses, can muck up your code big time, as I've found out. Apart from that use variables that you will understand when looking at code 6mths down the line. I agree with alot that I use things like strBookings if a string for example. Good luck x
Kris MCP
|
|
|
|
|
I would NOT prefix variables with a couple of letters that indicate the type, since that makes type changes hard. You may start with an array of something, later turn it into a list, and afterwards decide to go for a dictionary. You then would have to rename the variables all the time.
I do recommend using meaningful names, using full english words (except for very local variables), and using singular and plural as applicable, so I would write:
For Each stu as Student in students
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
I was able to receive, sent email from vb.net application on POP3 mail server, so how can I delete, view sent items and other email functionality using vb.net.
Thank you.
Thayhor
|
|
|
|
|
|
Thanks for your quick response. I have come acrosss the Chilkat mailMan, what I need is how I can achieve this without a third party license class. Can I get a free dll or class that can do that. What I really what is how to implement something like MS Outlook using Vb.net.
|
|
|
|
|
MS Outlook uses a database to store all mail items. You will have to research how to store a mail item to a database.
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi all,
i have a doubt about the DST. I want to ask whether DST is related to State or Country?
Please guide me or provide some helpful link
|
|
|
|
|
It is related to neither. It is an independent setting.
My advice is free, and you may get what you paid for.
|
|
|
|
|
i need a most simple code to upzip a folder in vb.net
|
|
|
|
|
Not enough to google for it, apparently.
J# can do it, so if you're happy to write code that uses a J# dll, you can do that. Otherwise, you need to buy a third party component to do it.
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.
|
|
|
|
|
let us say, we have winzip and winrar installed in the machine.
How are we going to use them to unzip the folders?
|
|
|
|
|
We aren't. We are going to use SharpZibLib SharpZibLib
My advice is free, and you may get what you paid for.
|
|
|
|
|
You can do that, using command line arguments, but that would suck. Why did you ask this instead of reading what I told you ?
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.
|
|
|
|
|
I am trying to do a drag and drop from Windows Explorer to a listview box. I have tried a lot of stuff on MSDN and nothing seems to work. I am using VS 2008 Pro, OS is Vista and everything is up to date. Can someone Please point me in the right direction to something that does work.
THNX in advance for the help.
rspercy
If "You wash your feet and find a pair of socks " Then
"You ARE a Redneck"
End If
|
|
|
|
|
To receive data is actually pretty easy...
1) Set your listview's "AllowDrop" property to true, to let it receive data
2) In the DragEnter event... In there, you want to check the data being dragged to make sure it's what you want, and if so, set the AllowedEffects property of the DragEventArgs it gives you. This is to let windows know whether to allow the drop to occur.
3) In the DragDrop event... Read the data supplied in the DragEventArgs, and process it.
The actual data being passed will be in a few different formats, so set a breakpoint and take a look at the formats to see how you want to receive it.
Reference for WinForms: http://msdn.microsoft.com/en-us/library/za0zx9y0.aspx[^]
(WPF is pretty much the same, if I remember right)
|
|
|
|
|
I have a background worker that executes a long running database extraction. Just recently, i have been asked to add a feature to cancel the operation. My issue with this is that the extraction is not done in a single query. My worker executes a query then waits a specified amount of time (30 seconds to 24 hours) and then executes a second query. The first query extracts data from the (current time - a user specified length of time) to current time and writes it to a file. the second query extracts data from the current time to the (current time + a user specified length of time) and writes it to a file. the wait in the middle is the accomplished with an AutoResetEvent and timespan. The below shows some pseudo code for the DoWork and RunWorkerCompleted events
DoWork
...update a status data table that the process has started
...execute query from this point in time and up to 24 hours earlier
...wait(time span, false)
...execute second query
RunWorkerCompleted
if e.Error
status = "Failed
if e.Cancelled
status - "Stopped By User"
else:status - "Completed"
....update the status data table that the process has completed
How do I go about cancelling this background worker. I have tried cancelAsync but because the process could be in the waitone section, I wouldnt be able to check the cancellation pending property until after the wait has finished, which could be hours. Is there a way to cancel a reset event?
Thanks for any advice
|
|
|
|
|
Instead of doing one big wait operation, put it in a loop...
timeout = DateTime.Now.Add(timespan)
Do While DateTime.Now < timeout AndAlso Not e.Cancelled
Loop
If e.Cancelled Then
.....
|
|
|
|
|
Hi Ian,
thanks for responding... i didnt even think of a loop (probably because its too simple). One other question then if you dont mind, because my background worker does its tasks in a few steps, should I check the cancellation pending before doing each one
check cancellation
do first query
do wait ...while checking cancellation
check cancellation
do second query
|
|
|
|
|
Generally, yes, but it depends on what you're doing, and on how long you expect each operation to take. It's a matter of balancing it between extra code/complexity and more responsiveness.
|
|
|
|
|
The data extraction will be the most costly time wise but even then I dont expect them to take an extraordinarily long time. I guess i will have to do some testing and see the best options. Thanks again for the advice
|
|
|
|
|
|
Hi,
I have a strange issue which I can't seem to find an answer to. I'm using VB.net 2003. I've created a form which containes textboxes. When entering data into a textbox, it is being displayed in reverse. This seems to happen when I place the cursor at the begining of data that is already in the textbox or when I start typing into a NULL textbox.
I have other forms which work just fine. This one was working great until this morning. I'm sure that I can't be the first person to run into this issue but I can't seem to find an answer anywhere.
Thanks in advance,
Nick
|
|
|
|
|
When your cursor is at the beginning of the text box, are you clicking the mouse button to reset the cursor to the beginning of the text box?
You do know clicking your mouse in a text box will move the cursor.. right?
|
|
|
|
|
Hi,
May be that the "Home" key of your keyboard have drinked some drop of coffee or whisky?
modified on Tuesday, September 15, 2009 2:01 PM
|
|
|
|