Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. The eventhandler itself (TourGE, Tourshow and TourHide) will be defined with two parameters - the first is an object called sender by convention. This first parameter is the control that raised the event.
  2. Try right clicking on the primary output / whatever file you are creating the shortcut to and there should be an option to create a shortcut to the item in question, this shortcut can then be moved to the correct location.
  3. Re: update It could be a driver issue on the target machine - have you tried updating the drivers on one of the failing machines just to see if this fixes the issue?
  4. Sounds like a problem with the smtp server configuration then, is there any errors being logged from the smtp service.
  5. Is smtp under IIS configured correctly and is the service running? If you are getting no errors check the smtp service's pickup folder (IIRC under your inetpub\mailroot folder somewhere) to see if the emails are being generated.
  6. If you look at the underlying IL for the .Hide() method it just calls .Visible = false anyway.
  7. In a nutshell there is no difference. System.String is the underlying type specified by the .Net runtime (CLR) while string is just the C# keyword for the same thing. Same way that int in C# is the same as Integer in VB.Net and both are really System.Int32 as far as the CLR is concerned.
  8. You could simply set the label alternately to a "a" character and an empty string.
  9. Have you looked at the background worker component? It will allow you to run the email on a background thread without too much effort.
  10. A format of "yyyy/MM/dd HH:mm:ss.fff" seems to work fine though, not looked into the difference between fff and FFF though so you may want to see if this is suitable.
  11. Try Do While Not String.IsNullOrEmpty(line) line = srBestiary.ReadLine Me.txtDrops.Text &= vbNewLine & line Loop
  12. What version of VB are you using? Works fine in 2008 but haven't got any older versions to check...
  13. That was my fault, I meant declare it as a string array i.e. words() As String
  14. Not really looked at the performance of string.replace under .Net, especially the later versions - it might be worth trying it and seeing if the performance does suffer. I suppose you could also try something like Dim res As String = String.Empty For Each c As Char In From If c <> What Then res &= c End If Next Return res and see if that compares - I certainly wouldn't take my code as an improvement without doing some real performance testing though. An alternative might be to investigate using RegEx.Replace instead - again I have no idea how this will affect the performance but it is worth considering.
  15. The string handling stuff could use String.Substring e.g. Dim s as string Dim h as string = "Hello World" s = Lefth, 3) s = Right(h,3) s = Mid(h, 2, 3) 'could be written as s = h.SubString(3) s = h.SubString(h, h.Length -2, 3) s = h.SubString(h,2,3) The FileExists Method could be replaced with System.Io.File.Exists() and will save instantiating the FileSystemObject every time. The ReturnContents could be replaced with Public Function returnContents(ByVal strFile As String) As String Dim sr as new StreamReader(strFile) dim s as string = sr.ReadToEnd() sr.Close return s End Function In the pack method you might want to declare words as string rather than object. I'm not sure what the StripOut method is supposed to be doing from just glancing at it - any chance you could give an explanation?
  16. You might want to start by replacing the use of FileSystemObject with the inbuilt .Net classes and methods found under system.io e.g objWrite1 = myObjFs1.CreateTextFile(My.Application.Info.DirectoryPath & "\customerids.txt") 'could be replaced with Dim sw As StreamWriter sw = File.CreateText(My.Application.Info.DirectoryPath & "\customerids.txt") myObjFs2 = New Scripting.FileSystemObject 'Create an empty text file myObjFs2 = CreateObject("Scripting.FileSystemObject") objWrite2 = myObjFs2.OpenTextFile(My.Application.Info.DirectoryPath & "\customerids.txt", Scripting.IOMode.ForAppending, True) 'could be replaced by Dim sw As StreamWriter sw = File.AppendText(My.Application.Info.DirectoryPath & "\customerids.txt") I would also look at replacing the various functions found under Microsoft.VisualBasic.Strings with the methods of the string class directly. Without having access to the Pack, StripOut and ReturnContents methods I couldn't say if any optimisations could also be made there. That should get you started, if there are still issues feel free to post back here though.
  17. At the end of the day is there anything in your code that is really worth obfuscating? Unless you have some really propriety algorithms that a 3rd party is likely to want to steal the benefits of obfuscation might be minimal compared to the trouble you are having getting it to work.
  18. The attached project includes a couple of pop3 related classes - covers the more common commands such as List, Dele, Retr etc. Might be enough to get you started.WindowsFormsApplication1.zip
  19. I think I have an old but very basic pop3 class hanging around somewhere - will post that if I can find it. It isn't the most functional but should be enough to do what you need to do.
  20. When you say it doesn't work at all are you refering to the InvalidOperationException that is thrown due to cross thread calls? If so this is due to .Net 2 and later being more strict about updating the UI from anything other than the main UI thread - this was a bad idea even in .Net 1 it just wasn't enforced in .Net 1. Any line that is either in the StartDLThread method or is called from it cannot directly update the user interface, you need to get the form to invoke a method to do the real work. The following should give you an idea http://www.xtremedotnettalk.com/showthread.php?t=100158&highlight=invokerequired http://www.xtremedotnettalk.com/showthread.php?t=101944&highlight=invokerequired
  21. The mybtn object is a button control, just use it instead of the normal button control.
  22. http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?ID=23 might be worth a look as a way to avoid needing the pdb files going into the gac.
  23. In blend you can select the relevant controls and then right click on them and select 'Make Control', blend will then do all the hard work for you.
  24. mybtn.TextBoxThing = textBox1;
  25. Re: Tabs to right Add TabStripPlacement="Right" to the element in the xaml markup and it should solve your problem.
×
×
  • Create New...