Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. As both the functions return / accept string based data then depending on the size likely to be returned either a varchar or text data type might be the best. Although as you are using unicode strings nvarchar or ntext is probably more suitable.
  2. Public Class test Public OnMouseActivity As MouseEventHandler Public Sub MySub() If Not OnMouseActivity Is Nothing Then OnMouseActivity() End If End Sub End Class should do it ;) - Events are slightly different under vb
  3. Public Sub MySub() If Not OnMouseActivity Is Nothing Then End If End Sub should do it.
  4. Perhaps I don't get your point but personally I really don't see this as being a big problem. For most business software the algorithms etc. aren't of such importance that decompiling them would be a show stopper - an obfuscator would probably be useful in such a situation if you did need to make it harder to decompile though. If you are in the habit of giving your assemblies a strong name then this should help prevent people hacking the il itself as any changes to the file will prevent the CLR loading it, this could possible help reduce the number of cracks that simply patch a few bytes here and there to disable serial / dongle / whatever checks. Ultimately it becomes a trade off, writing code in C / C++ would make it much harder (not impossible) to decompile but is a far more labour intensive approach to software development. .Net gives a much easier development process but there is the possibility of decompilation (again how serious this is depends on exactly what you are doing). The ability to mix languages may be of use - write the critical bits in C / C++ / personal language of choice and then call this functionality from the .Net application. If decompilation is such a major problem then .Net is probably not the most suitable tool and should have been discounted early in the application design phase. Describing this as just seems a bit of an overreaction given the fact that any software can be reverse engineered if it is deployed out to client machines regardless of language - the trick is to figure out how to avoid sensitive routines etc. being deployed in this manner.
  5. In this case the approach is wrong - you shouldn't be storing the encryption key on a client when requiring secure network communications or attempting to design your own encryption algorithms. Given the above situation I would suggest using an established and secure mechanism like SSL to handle the encryption rather than writing my own anyway.
  6. Just to clarify a couple of things... Firstly each of the classes expose the same methods (or a least some of the methods are the same) that need to be moved to an interface - correct? Secondly you would like to be able to create a generic List object that could contain any of these objects - also correct? If so you would just need to define a new interface that contains the relevant methods and get each of your existing classes to implement this interface. This will probably require a little bit of editing in VB to make sure each of the existing methods is followed by the relevant Implements statement as well... Generics can be restricted to classes that implement a particular Interface as explained by marble_eater in this post
  7. Is the server actually stopping and needing a restart or are you manually having to start it yourself? Have you checked the free diskspace on the drive(s) containing you database files - if you run out of room this can happen. Are there any other log messages generated at the same time? (check the System and application logs through Event viewer and also look in the SQL logs as well).
  8. Have you renamed a form or resx file recently?
  9. Decompilation of .Net code in most cases isn't really that big a deal anyway. In terms of securing software I've yet to see any other language that prevents people hacking / cracking the software regardless of how complex the resultant code is. At least under .Net if you have given your application a strong name then changes to the .exe / .dll are detectable by the runtime and this will prevent execution of a compromised application. If you are regarding the securing of the ideas or algorithms behind the application then one of the many obfuscators for .Net might be worth investigating - however you really need to decide if the effort is really justified. If your code is really that revolutionary then something like a patent may be a much more effective way of securing your IP.
  10. Did you check the server is using the same version of .Net as your project?
  11. Try ... Catch isn't really that slow if you measure it - it does get an awful lot of bad press... as a fairly non-scientific test I just tried running Dim t As Date = Date.Now For i As Integer = 0 To 1000 Try Dim fs As New IO.FileStream("c:\pagefile.sys", IO.FileMode.Open, IO.FileAccess.Write, IO.FileShare.Delete) Catch ex As Exception End Try Next Dim ts As TimeSpan = Date.Now.Subtract(t) MessageBox.Show(ts.TotalMilliseconds.ToString("#,##0.00")) as it will deliberately cause an awful lot (i.e. 1001) of IOExceptions to be thrown and caught and in a Debug build it still came to just under 6 seconds (5,944 milliseconds) on it's first run and only 4.7 seconds on a second run once JIT compilation was removed from the equation. Under a release build the first run was only 244 milliseconds and remarkably similar on subsequent runs - not much of a performance hit in any real terms.
  12. It might be worth having a look with ildasm.exe and see how the DataSet / DataTable system actually works. From what I remember (not got .Net on this PC yet) a Datatable maintains a reference to it's parent dataset and vice-versa, I suppose on certain property changes the Datatable will query the associated dataset and throw the relevant exceptions. If you are considering this it might be worth defining a standard interface that all items that can be added to your collection can implement - this way at least you can define your own mechanism for this kind of behaviour.
  13. Not reliably - even if you check before attempting to open the file there is no guarantee that the file hasn't been opened in-between you checking and then opening it.
  14. Easiest way would probably be to call .CreateGraphics on the button and then draw onto this - something like Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim g As Graphics = Button1.CreateGraphics g.DrawLine(Pens.Red, 0, 0, Button1.ClientRectangle.Width, Button1.ClientRectangle.Height) g.DrawLine(Pens.Red, Button1.ClientRectangle.Width, 0, 0, Button1.ClientRectangle.Height) g.Dispose() End Sub should do the trick.
  15. If you go to start then run and type secpol.msc you should get the local security settings editor, haven't got access to it on this PC so I can't be exact - however if you search through the security settings there should be one for Log On Locally - add the aspnet account to the existing list of users.
  16. Which registry key are you trying to read? Do you have the appropriate permissions to read it?
  17. Just to check - you are logging into the server with the ASPNET aren't you?
  18. Does the DataSet contain the same tables etc. that the report is expecting?
  19. ASP.Net provides a control for just this sort of thing - the Literal . Position it within the HTML markup where you want the value to go and just assign the appropriate sting to it's .Text property from your .Net code.
  20. My initial thought would be to avoid using Response.Write directly from the html markup ;) Could you not use a literal control within the markup and assign a value to it from the Page_Load event instead?
  21. Bottom line is you shouldn't mess with the UI from any thread other than the UI thread itself. Adding COM threading issues into the problem (like the IE control) is pretty much doomed from the start.
  22. You might find it pretty nasty to work with multiple controls in that way from multiple threads - you shouldn't interact with the UI (or UI controls) from anything other than the main UI thread. It might be better in the long run to see if it's possible to just post the correct values to the site and read the returned response directly.
  23. If you step through the code does the DataSet contain the correct data after the da.Fill(ds) line? Also the line Dim da As New OleDb.OleDbDataAdapter(com.CommandText, con) would be better written as Dim da As New OleDb.OleDbDataAdapter(com) as it saves creating an extra command object.
  24. Business version should be sufficient, I think it should install on any version of Vista.
  25. Depending on how you are communicating with the server(s) this might be easy enough to do. If you are using the HttpWebRequest class to communicate it offers a Begin / End GetResponse pair of methods that could be used. If you give a bit more detail about how you are currently approaching the problem then we can offer a bit more specific advice.
×
×
  • Create New...