
rbulph
Avatar/Signature-
Posts
398 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by rbulph
-
How can I open a web page and then get the handle of the window it's opened in? I've tried the following as a start, but, although the web page opens OK, k is always Nothing. Dim k As System.Diagnostics.Process = Process.Start("http://www.google.com")
-
OK, thanks. I probably need to have a think about ensuring that later versions of my programme will be compatible with earlier ones and I guess this is along the same lines.
-
I've just discovered the Object Test Bench. Is it useful? If so, how would you use it? All my objects are so interconnected that I think it would be more work to set them up on the test bench than to simply run the application and set them up as intended.
-
Well I've had another look at this and things are working better. The problem seemed to be using an overload for the constuctor for cursors that took the name of a cursor resource as a string. But I've changed that to use a stream instead, and it's fine. If I run the dotfuscated application it works fine. But when I deploy the application of course it doesn't work. As soon as it tries to access a setting I get the error "Configuration system failed to initialize". Any ideas what I'm doing wrong to cause this? Generally I'm a little unclear about exactly what I need to include and exclude in the setup project.
-
You would think that providing for the addition of shortcuts to your application in a setup project would be simple. But if I go to the file system and right click on the desktop folder, the option I get is to "Create Shortcut to User's desktop". This is completely silly. I tried adding this and installing my application and this really is what the installer does. It adds a shortcut on the user's desktop to the user's desktop. So when he clicks on this he gets a window showing the contents of his desktop. Similarly with creating a shortcut in the user's program menu. Unbelievable. I have tried resetting the Target property in the Properties Window, and right-clicking on my application to create a shortcut to it, but to no avail. Can anyone explain to me how to go about doing this successfully?
-
Yes, I am concerned about a 3rd party stealing the code. I'm going to be very frustrated if it's this easy for them to do it.
-
OK, I fixed this by excluding all the settings from obfuscation. But I now have a lot of problems with my application running in different ways when installed to how it does in development. For instance the splash screen freezes and cursors don't appear. My feeling at the moment is that dotfuscator is useless and that I have no choice but to distribute my code non obfuscated.
-
I have just started using dotfuscator. When I try to run the dotfuscated application it seems that none of the project settings (My.Settings) are recognised, and this causes an error. How do I fix this?
-
Is there any way to get a computer to wake from standy automatically? On coming out of standy there's a requirement to press a button against my username before the computer is operational so I'd want to get past that step automatically too. Grateful for any help.
-
Thanks, that seems better. I'll let you know if I run into any problems.
-
I'm trying to get hold of basic information about the screen cursor. But the following doesn't work at all. What am I doing wrong? Public Class Form1 Private Declare Function GetCursorInfo Lib "user32.dll" (ByVal pc As CURSORINFO) As Long 'Idea to only click when cursor is a hand. Can't get it to work in .net. Works OK in VB6 though. Structure CURSORINFO Dim cbsize As Long Dim flags As Long Dim hCUrsor As Long Dim p As Point End Structure Structure PointAPI Dim X As Long Dim Y As Long End Structure Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim ff As New CURSORINFO ff.cbsize = System.Runtime.InteropServices.Marshal.SizeOf(GetType(CURSORINFO)) GetCursorInfo(ff) With ff 'All of the following just show zero. Label1.Text = .p.X Label2.Text = .p.Y Label3.Text = .hCUrsor End With End Sub End Class
-
How do you do windows (forms) that "Snap"together?
rbulph replied to Denaes's topic in Windows Forms
Any developments on this? Would divil's SandDock still be the way to go? Or are there any free packages out there? -
PropertyGrid - suppressing expansion for an object reference.
rbulph replied to rbulph's topic in Windows Forms
I've discovered that, while I can't stop the + mark from appearing, I can at least stop it from opening if the user clicks on it with code like this: If prgOne.SelectedObject IsNot value Then Return Nothing in the GetProperties override of the ExpandableObjectConverter. If the user clicks on the + mark it disappears. -
PropertyGrid - suppressing expansion for an object reference.
rbulph replied to rbulph's topic in Windows Forms
Well I have an ExpandableObjectConverter (which inherits from TypeConverter) for the class already, for various purposes, but I can't figure out how to remove it for the properties. -
PropertyGrid - suppressing expansion for an object reference.
rbulph posted a topic in Windows Forms
I've got a class that I want to display in the propertygrid. Some of its properties refer to other instances of the class. I'd like to display those properties in the grid using just the ToString value for the other instances. But what happens by default is that a plus/minus box appears to the left of the property and all the properties of the secondary object are listed if the user opens this up. The property grid can be opened up indefinitely and it gets to look really confusing. How can I prevent the properties for the secondary object being expandable? -
Hmm, it's something to do with the richtextbox ultimately being in an MDI Form. It tabs to the next control in the MDI Form, not a control in the class, as I would have expected. Maybe I need to set the TabStop for all controls in the MDI Form to False to get this to work. I'll come back to this later.
-
Does anyone have any idea why AcceptsTab might not be working? I have a class which inherits from TableLayoutPanel and contains a RichTextBox in one of its cells. I have set AcceptsTab to True for the RichTextBox and TabStop to False for the class, the RichTextBox and the other controls that it contains. But when the RTB has focus and the user presses Tab, the focus vanishes - it seems that the RTB loses focus and no other control receives it - it's just lost. I have tried duplicating this in a small project, but can't - the tab key is accepted perfectly well. Any ideas?
-
I'd like to customise the property grid so that there is a button in one row that the user can click to perform an action. By giving the relevant property an Editor attribute and having a class inherit from UITypeEditor I can get a button with an ellipsis to appear on the right of the property grid row. But I don't want an ellipsis there. I would like to put my own picture there, or if the button could just be blank that would be OK. Can anyone help?
-
I've got a table layout panel which contains some text boxes. I'm giving the user the option to decide whether to display these in 3D or Flat. If they are flat, their height is less. To keep the display looking good I want to reduce the heights of the rows in the tablelayoutpanel. It seems to be incredibly complicated to set the row height - something to do with adding RowStyles to the tablelayoutpanel without even referring to the row you're trying to change the height of. Does anyone have an understanding of how to do this?
-
Thanks for the explanation.
-
Thanks, that works fine. In converting it to VB I need to declare Key as Key(7) rather than Key(8) but presumably that's just a difference in the language.
-
Following on from here, but getting to be a different topic really, so I'll start a new thread. Is there any method provided by VB for obtaining an eight byte hashcode from a string? The String's GetHashCode method seems to return a hashcode of 9, 10 or 11 bytes so is not quite what I'm after. Or should I design my own?
-
I've got this working now, using the code here . But regarding what you're saying about using the user's password as the key, the Key for the DESCryptoServiceProvider has to be eight characters long, so I would have problems storing the user's password there unless I restricted him to having passwords of this length. But I think that I probably don't want to use a standard key for all my files either, since then anyone who got hold of that would be able to open all password protected files relating to my programme. So maybe I should just use the first eight letters of the user's password, padded out if necessary, and in addition store the whole password in the file. I'll also have the possibility of a password for modifying files. It seems that having the correct Initialisation Vector is not critical for decrypting files, so I can't store it there. Short of double encrypting files I think I will have to store this in the file. But security for this is not so important so that seems alright.
-
I'm trying to use the KnowledgeBase article, but it's not working. The decrypted stream is empty. Can anyone see what I'm doing wrong? Imports System.Runtime.Serialization.Formatters.Binary Imports System.IO Imports System.Math Imports System.Security Imports System.Security.Cryptography Imports System.Runtime.InteropServices Imports System.Text Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim j As New saveobject j.name = "Wally" j.ID = 145 Dim ms As New MemoryStream With New BinaryFormatter .Serialize(ms, j) End With Dim s As String = "Qwertyui" EncryptFile(ms, "C:\TestFile.abc", s) ms.Flush() ms.Close() Dim fs As FileStream = New FileStream("C:\TestFile.abc", FileMode.Open, FileAccess.Read) Dim ms2 As MemoryStream = DecryptFile(fs, s) Dim k As saveobject With New BinaryFormatter k = .Deserialize(ms2) 'get an error here because ms2 is empty. End With Text = k.name End Sub Sub EncryptFile(ByVal sInputFile As MemoryStream, _ ByVal sOutputFilename As String, _ ByVal sKey As String) Dim fsEncrypted As New FileStream(sOutputFilename, _ FileMode.Create, FileAccess.Write) Dim DES As New DESCryptoServiceProvider() 'Set secret key for DES algorithm. 'A 64-bit key and an IV are required for this provider. DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey) 'Set the initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey) 'Create the DES encryptor from this instance. Dim desencrypt As ICryptoTransform = DES.CreateEncryptor() 'Create the crypto stream that transforms the file stream by using DES encryption. Dim cryptostream As New CryptoStream(fsEncrypted, _ desencrypt, _ CryptoStreamMode.Write) 'Read the file text to the byte array. Dim bytearrayinput(sInputFile.Length - 1) As Byte sInputFile.Read(bytearrayinput, 0, bytearrayinput.Length) 'Write out the DES encrypted file. cryptostream.Write(bytearrayinput, 0, bytearrayinput.Length) cryptostream.Flush() cryptostream.Close() End Sub Function DecryptFile(ByVal InputStream As FileStream, _ ByVal sKey As String) As MemoryStream Dim DES As New DESCryptoServiceProvider() 'A 64-bit key and an IV are required for this provider. 'Set the secret key for the DES algorithm. DES.Key() = ASCIIEncoding.ASCII.GetBytes(sKey) 'Set the initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey) 'Create the file stream to read the encrypted file back. ' Dim fsread As New FileStream(sInputFilename, FileMode.Open, FileAccess.Read) 'Create the DES decryptor from the DES instance. Dim desdecrypt As ICryptoTransform = DES.CreateDecryptor() 'Create the crypto stream set to read and to do a DES decryption transform on incoming bytes. Dim cryptostreamDecr As New CryptoStream(InputStream, desdecrypt, CryptoStreamMode.Read) 'Print out the contents of the decrypted file. Dim OutputMemoryStream As New MemoryStream Dim fsDecrypted As New StreamWriter(OutputMemoryStream) fsDecrypted.Write(New StreamReader(cryptostreamDecr).ReadToEnd) InputStream.Flush() InputStream.Close() Return OutputMemoryStream 'Problem - this is empty! End Function End Class <Serializable()> Friend Class saveobject Friend name As String Friend ID As Integer End Class
-
Finally looking at this now (over two years later!). This seems to be what I need. I suppose I need to have a universal key for encrypting files in cases where the user has specified no password. If this key fails to decrypt the file then I know that I need to prompt the user for the password and try again with that.