mark007
Avatar/Signature-
Posts
185 -
Joined
-
Last visited
About mark007
- Birthday 05/18/1980
Personal Information
-
Occupation
Actuary, VB Developer, Web Developer
-
Visual Studio .NET Version
VB/C# Standard
-
.NET Preferred Language
VB
mark007's Achievements
Newbie (1/14)
0
Reputation
-
Still intrigued about whether anyone has any thoughts on this but I've rethought how things will work and come up with a different approach that I'm happier with anyway so thought I'd share. I've now set the library up so that the object can either be run asynchronously using the background work or synchronously without it - just set boolean in the call. If it is set to synchronously then progress is not updated and the library just gets on with the work and returns. If set async then it raises progress and completion events that a form using the library can make use of to update the progress. This feels quite a neat solution that should meet all the uses I have for the library. Effectively I've moved to the windows forms model I outlined earlier and am requiring the user of the library to implement a progress bar rather than having one built into the library.
-
Look into system.text.regularexpressions. Something like this would do it: Dim r As New System.Text.RegularExpressions.Regex("<title>(.+?)</title>") Dim m As System.Text.RegularExpressions.Match = r.Match(strText) System.Windows.Forms.MessageBox.Show("Title is: " & m.Captures(0).Value) Though note I've not tested. Mark
-
I'm putting together a class library and one of the functions within it is to update a local database with information obtained from a web service. I'd like to have the option to show the progress of this so have also put a small form in the library with a progress bar on it. Everything works but I'd like to make the progress bar more reliable and smoother. It's the same old problem of tying up the UI thread with an intensive operation so the UI updates aren't done. With a windows form application I'd have gone straight for a background worker. However with a class library this if different and I'm not sure how to approach this/whether it will work. Windows Form: Form Loads Async Process started on worker worker reports progress to form event form updates UI worker continues etc. Worker reports complete in form event Form updates UI The key point here is the form is loaded and listening for events throughout this. Class library: Create new object Call update sub on object update sub creates instance of progress bar form and starts async worker worker reports progress to object which updates progress form But: Update sub has completed by this point so the rest of the procedures in the code that instantiated the object will have ran by this point and the object may have been set to nothing. Therefore there is nothing to report the progress to. Does that make sense? I've not tested this and there could be some stuff going on int the .Net underbelly that ensure the object is kept alive until the worker has done but this doesn't feel right. What I effectively want to do is tell the code to stop what it is doing but keep updating the UI as appropriate until the worker has finished. Hope that explains the scenario. I guess to add a little more, the code will be initially called from within a COM interop component loaded in Excel. So: Excel Loads Excel calls load events on addin Addin references library Load events instaniate object in library and call update Any suggestions really apppreciated. Mark p.s. The workaround to this is to use 1 thread and form.refresh with every update - I suspect this slows things down quite a bit though.
-
This will do the first bit I think: [a-zA-Z0-9']*[a-zA-Z]+[a-zA-Z0-9']* :)
-
Thanks - that takes care of part3 quite nicely!
-
1. In asp.net you can store data in the cache safe in the knowledge that if memory is a problem some of it will be dumped. I am creating a dll that will serve as an Excel addin. Within it there will be times at which an extremely large number of calculations will be carried out. Alot of the intermediate results will be the same though so I wish to cache them under a string id of the calculation arguments. I could obviously do this using a hashtable easily enough however I was wondering if there is a built in cache that will manage situations when memory runs low as per in asp.net. 2. If anyone can think of a better=faster way of storing intermediate results other than storing under a key equal to a concatenated argument list I would appreciate it. 3. Finally how many concatenations are required before using a stringbuilder becomes faster? Cheers! :)
-
You just need to declare the button: Protected btnDelete as Button within your code behind then refer to btnDelete. If you are using Visual Studio.Net then this will be doen automatically.
-
Not sure if you are talking about Excel or not ut this Leagcy VB code might give you some ideas: http://www.thecodenet.com/articles.php?id=9
-
Well that was the point of the brackets i.e. you replace "(,)([^,]*)$" with " and $2" How does your's work Ingis? I can't say I follow it...
-
Ah ok, how about: "(,)([^,]*)$" :)
-
You don't need a regex for this. Just use: Dim s As String="Brown, Brown, Brown, Brown, Brown, Brown" Dim pos as integer=s.LastIndexOf(",") :)
-
Well you need to compare the code of the 2. I don't have a login at the code project so cannot download the spurce for the c# implementation. In particular you need to check that they use the same initialisation params.
-
Check out the body and HTMLBody properties of the MailItem class. :)
-
I can't say I know much about the algorithm but it would be useful to see how you are encrypting and attempting to decrypt. It may be a case of different default being used to seed part of the encryption.
-
Not had chance to try it bu the above looks good - thanks! :)