Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You are getting different results after every run because you are generating a new key and new IV every run, you may be better of pre-generating a key / IV and storing those somewhere.
  2. .Net already has a few classes for dealing with encryption - have a look under System.Security.Cryptography - plenty there to be going on with ;)
  3. You can define a column type of XML and then associate a schema with the column - this will allow you to persist objects in a structured format. Only briefly played with it so I can't really say how good / bad the implementation is though.
  4. I'm surprised the profanity filter allows the word 'Daikatana' to be used.
  5. You may find this link useful.
  6. If the MDB file is on the same server as the ASP.Net application then it wouldn't require any ports opening as it's just local file access.
  7. If you just want to use this file for adminastrative control then using an application.config file may be the way to go. If your application is name app1.exe then the config file would be called app1.exe.config example of a file would be In your code you could then do something like Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader dim connString as string = CType(configurationAppSettings.GetValue("ConnectionString", GetType(System.String)), String) to read the value at runtime
  8. this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing); is probably what you are looking for - you were right though it was just a matter of getting the correct arguments.
  9. Does this 3rd party component not expose any events for responding to mouse actions?
  10. What do you need this information for? There may be a better way to achieve what you are trying to do.
  11. If you just need access to these details for display or logging purposes then you can use the excepetion's StackTrace property like : Try Dim i As Integer Dim s As String = "Fred" i = s Catch ex As Exception MessageBox.Show(ex.StackTrace) End Try If you require programatic access then if you could give a little more detail about how your code is organised / what you are trying to do then we can offer more help.
  12. When you do Dim sGood() As String Dim sBad() As String you are declaring the arrays but not their size you will either need to set them to the correct size initial i.e. Dim sGood(100) As String Dim sBad(100) As String or use Redim Preserve to resize the array at runtime. Alternatively you may want to consider something like an ArrayList as this removes the need to manage the size explicitly.
  13. Rather than bind to the DataTable create a Dataview of the DataTable and bind to that - one of the properties of a data view allows you to specify if you can create new records (I think it is called AllowNew). If you disallow new records then you shouldn't see the extra row.
  14. Is there a particular problem you have or an idea for what you need multithreading for? Quite often multithreading in a web app will not behave as you would expect due to the way HTTP requests are handled.
  15. The InternetOpen function wouldn't really help in this case as I don't think you could mix calls to the unmanaged InteretOpen function and then used managed classes to send your e-mail. Also the InternetOpen function would only work with a CERN type proxy (HTTP, FTP and gopher) rather than SMTP. You will probably need the proxy server / firewall / NAT device between you and the internet to be reconfigured to allow SMTP traffic through (port 25 needs to be opened for outbound traffic).
  16. Try something like Dim myuc As UserControl 'you may be better using the correct control type here. dim c as control For Each c In Me.Controls if typeof c is UserControl then myuc.Visible = False end if Next myuc = Me.FindControl("ucsub_x22release") myuc.Visible = True also could you not just put the controls within a panel and change the panel's visibility rather than each control individually.
  17. What kind of proxy are you using and where are you telling your code to use it? If you mean there is a proxy server between yourself and the internet then it depends on the proxy configuration - most proxys will allow HTTP access out to the internet but may not be configured to allow SMTP, which you require. You may need to speak to your ISP / Administrator / provider to see if the proxy could be reconfigured.
  18. You should be able to access it from derived classes without any extra effort? If you try to type _SomeMember do you get any errors?
  19. Whoops - forgot that bit, what happens when you are trying to code and hold a conversation at the same time. Denaes - go with Divil's suggestion which would look similar to Protected Overridable Sub OnColourChanged(args as MyEventArgs) ColourChanged(Me, args) End Sub
  20. If you create a MFC based App then WinMain is still there it's just buried within the MFC framework. you may find these links are worth a quick read as they may shed a bit of light on the subject http://www.codeguru.com/Cpp/Cpp/cpp_mfc/tutorials/article.php/c4131/ http://www.fastgraph.com/help/first_mfc.html
  21. If you want your control to behave like the standard controls (i.e allow multiple events to be routed to a single event handler) then you should really follow this model. In practice it is easy enough to do - if you require no extra information to be passed to the event handler then just use System.EventHandler as an event type Public somethingHappened As System.EventHandler Protected Overridable Sub OnSomething() somethingHappened(Me, New System.EventArgs) End Sub putting the raising of the event in it's own function (On.......) makes it easier to raise from multiple places and cleaner for code that inherits your control. If you need to pass custom information then create a class that derives from System.EventArgs and add any relevant properties required. Then create your own delegate for the event. Public Class MyEventArgs Inherits EventArgs Private _OldColour, _NewColour As Color Sub New(ByVal oldColour As Color, ByVal newColour As Color) _OldColour = oldColour _NewColour = newColour End Sub Public ReadOnly Property NewColour() As Color Get Return _NewColour End Get End Property Public ReadOnly Property OldColour() As Color Get Return _OldColour End Get End Property End Class 'to use the above class Public Delegate Sub ColourChangedEvent(ByVal sender As Object, ByVal e As MyEventArgs) Public ColourChanged As ColourChangedEvent Protected Overridable Sub OnColourChanged() ColourChanged(Me, new MyEventArgs(color.Red, color.Black) End Sub
  22. MsgBox is really just a legacy function for compatability with VB6 and earlier, MessageBox.Show is the .Net function and as such is the one you should be using.
  23. I also quite like the integration with SQL 2005 Express. For doing a simple bit of work on a laptop the fact you get a SQL database without the need to go and configure a full SQL server installation can be handy.
  24. If you step through the code in the debugger does searchPart really contain the word "FAX" as I can't see you assigning anything to it in the code snippet you posted above. Out of interest does the file have Option Explicit On and Option Strict On at the top?
  25. Main is the MDI PArent - correct? Form1 is a child of the Main form - also correct? ChatForm is another child of the Main form - correct?
×
×
  • Create New...