Jump to content
Xtreme .Net Talk

IngisKahn

Avatar/Signature
  • Posts

    436
  • Joined

  • Last visited

Everything posted by IngisKahn

  1. A quick brainfart: just create a custom html doc that opens your page with the specified options and open that instead.
  2. Object Browser is your friend :)
  3. How is that different from an application written in any language?
  4. "Non-secure due to ASCII code" -- not sure what you mean by that. The SecureString class is great for dealing with passwords. Obfuscation tools are another option, thou you'll have to spend some dough. Finally, putting up a message box right after password validation is a flashing "Start looking here" sign to crackers. I've been coding and hacking ASM and P-code for years and I can say that while you can make it harder, you can never (untill we all start using secure processors) make code hack-proof.
  5. Well, IndexOf is a means to an end. As such, there's no one best method to use RegEx instead of String.IndexOf.
  6. Rather than replacing the IndexOf function, I'd ask what you're trying to do.
  7. When I'm not familiar with X, I type X into my favorite search engine. ;)
  8. This will match a password that has at least 2 numbers, 2 lower case letters, 2 upper case letters, and 8 to 20 characters: ^(?=.*?\d.*?\d)(?=.*?[a-z].*?[a-z])(?=.*?[A-Z].*?[A-Z])[\da-zA-Z]{8,20}$ If you just want to check if it has multi-case and digits: ^(?=.*?\d)(?=.*?[a-z])(?=.*?[A-Z])[\da-zA-Z]$
  9. Check the sticky for info and tools; I use Regex Master. Regex regex = new Regex(@"(?<=href="")\S+?(?="")"); Match match = regex.Match(htmlDocument); Now you can use the match object to iterate thru all the matches.
  10. (?<=href=")\S+?(?=") will extract everything in href="..." What else do you need?
  11. Check out the Regular Expressions forum.
  12. RegEx will do this for you. This should catch the entire image path: (?<=<img\ssrc=").+?(?=") If you just want the jpg file names: (?<=/)\S+?\.jpg These would need to be tweeked, but it's a good starting point.
  13. It is certainly possible (some hardcore use of System.Reflection would be my first guess) but it is far from practical. The type of relationship you're talking about is best represented thru use of class inheritance, not thru enums.
  14. I'm not sure what the problem is here... String.Substring and String.IndexOf are all you need. Anyway, if you're using RegEx then .Matches will return a collection.
  15. If you have a function where you think there is a remote possibility that it could throw an execption then 99% of the time you should use it. So the basic answer is yes.
  16. The correct translation of if ((string1 = string2) != null) { //.... } is: string1 = string2 If Not string1 Is Nothing Then '... End If
  17. Confucius say: "Never use public or protected fields."
  18. Why not? CLS Compliance deals only with the public interface.
  19. It was posted by a few people on blogs.msdn.com, but a quick web search didn't find it... The recommendation is that no variable name decoration should be used (Hungarian or underscore). Any slight benefit gained from decorations is superceded by IDE functionality. (Especially in VS2005; it�s like night and day compared to VS2003)
  20. Hmm, that's a bit disturbing. More so since the guideline originated from an internal MS memo. Perhaps it was implemented before the edict was handed down. :(
  21. Ya, but the whole point is that you're advised not to use underscores in names (esp. as a prefix) due to readability/flow issues. Then again, if you're the only person working on the code then you can do whatever you want privately so long as you follow P&P for the public interface.
  22. MSDN loves you :)
  23. According to Microsoft P&P: class Example { int someMember; public int SomeMember { get { ... } set { ... } } public Example(int someMember) { // only in the constructor do you need to use 'this.' this.someMember = someMember; } } Of course this won't work in VB and even though MS doesn't target P&P for VB the consensus is to prefix with 'm' or 'my' sans underscore.
  24. Why not e.KeyChar == '\r'
×
×
  • Create New...