Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

thepolishguy

@thepolishguy
About
Posts
21
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Encryption and Decryption Problems
    T thepolishguy

    So, would you suggest I read the file first and append the content to it the result of that read, then encrypt the whole thing? How are user logon records stored typically?

    C# security help question

  • Encryption and Decryption Problems
    T thepolishguy

    The file is written to every time a user logs on to the application. I'm appending the new user information to the document each time the user logs on. So, the WriteLine is performed once each time through the application, but the file is appended the next time through.

    C# security help question

  • Encryption and Decryption Problems
    T thepolishguy

    The log variable is simply this: log=this.txtBxUsername.Text + ", " + DateTime.Now; I want only to record the username and the time the user logged on. administrator, 1/16/2006 10:55:37 AM တတတတတတတတ襢⭺鉳䀗霳ꇳtrator, 1/16/2006 10:55:48 AM တတတတတတတတ垵쌂멨蛫륢trator, 1/16/2006 10:56:02 AM တတတတတတတတ뙩鲂팒ᬵ밞拑䔏⎗trator, 1/16/2006 10:56:15 AM This is an example of the output I receive.

    C# security help question

  • Encryption and Decryption Problems
    T thepolishguy

    Okay, here's the code I'm using to encrypt: public void EncryptData() { FileStream fs=null; if(File.Exists(Directory.GetCurrentDirectory() + "\\c#.ini") == false) { fs=new FileStream(Directory.GetCurrentDirectory() + "\\c#.ini", System.IO.FileMode.CreateNew); } else { fs=new FileStream(Directory.GetCurrentDirectory() + "\\c#.ini", System.IO.FileMode.Append); } byte[] Key = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16}; byte[] IV = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16}; RijndaelManaged RMCrypto=new RijndaelManaged(); System.Security.Cryptography.CryptoStream cryption=new CryptoStream(fs, RMCrypto.CreateEncryptor(Key, IV), CryptoStreamMode.Write); StreamWriter tnWriter2 = new StreamWriter(cryption, System.Text.Encoding.Unicode); tnWriter2.WriteLine(log); tnWriter2.Close(); fs.Close(); } And here's the code for Decrypting: private void DecryptDataLog() { FileStream read=new FileStream(currPath + "\\c#.ini", System.IO.FileMode.OpenOrCreate); byte[] Key = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16}; byte[] IV = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16}; RijndaelManaged RMCrypto=new RijndaelManaged(); System.Security.Cryptography.CryptoStream cryption=new CryptoStream(read, RMCrypto.CreateDecryptor(Key, IV), CryptoStreamMode.Read); StreamReader tnReader = new StreamReader(cryption, System.Text.Encoding.Unicode); this.textBox1.Text=tnReader.ReadToEnd(); tnReader.Close(); read.Close(); } When the file I'm writing to has more than one line, the first few characters of the 2nd, 3rd, etc lines of encrypted text show up as gibberish, while the rest of the line is OK.

    C# security help question

  • Encryption and Decryption Problems
    T thepolishguy

    I'm using the RijndaelManaged class to encrypt data. One of the things I want to encrypt is a log file that records the usernames of the people who log on to my application. When I write a single line to a file, I'm able to decrypt the data without a problem, but when I log onto the program again, thereby encrypting a second username to the file, I'm unable to successfully decrypt both lines of data. Only part of the second line is decrypted successfully. Does anyone have any suggestions/comments about why I'm encountering this problem?

    C# security help question

  • Bar Code Reading
    T thepolishguy

    Thank you. That will make life relatively easy for me.

    C# question

  • Bar Code Reading
    T thepolishguy

    I need to create a program that reads in bar codes. Would you be able to suggest how I might go about that task? Thanks

    C# question

  • Delay in TextChanged Event of ComboBox
    T thepolishguy

    I'm trying to change all text entries in a ComboBox to upper case. However, the first time I make a change to the text, the application does not register the changed text. The next time I make a change to the text, it works as specified. In other words, when the textchanged event is called, it converts the actual text to upper case letters. Is there a reason for this and how do I circumvent this problem? Thanks.

    C# question help

  • ComboBox Text Change Event
    T thepolishguy

    I need to convert any text entered by a user in a combo box to upper case. So, in the text_changed event, I added the code to convert the text to upper. However, the first time I select the combo box and change the text, it doesn't register the changed text, but the text that was previously present in the combo box (what is loaded into it during the form load event). Is there a reason for this and how do I correct it? Thanks.

    C# question

  • Data Commands OleDb
    T thepolishguy

    I need to allow an administrator to change login passwords for my application but am having problems with the syntax for the UPDATE statement. Specifically, I want to use Data Commands rather than working through a data set to make the updates because I will only need to do two operations with the MS Access database-verifying the old password/user id combo and updating the password to a new one. It seems to me that the UPDATE statement requires paramaters, but I am unsure of the syntax. Any help would be appreciated. Thanks.

    C# database help announcement

  • Change Password MS Access Database
    T thepolishguy

    Does anyone know how to allow a user to change the password in an MS Access database? My connection string (at least the path and password) is set programatically, read in from an encrypted file when the application loads, but I need to enable to user to change both the path and password for the database if necessary. Selecting the path is easy enough, but I'm not sure how to reset the password. Any help would be appreciated. Thanks.

    C# database help tutorial question

  • How to Compile an Application So that the Files in Application Folder are Delete-Protected
    T thepolishguy

    Is there a way to compile an application so that the files included in the application folder cannot be delelted unless the user uninstalls the program? Or, at least, is there a way to protect certain files from being deleted that may be essential to the program's operation?

    C# tutorial question

  • Path to Access Database
    T thepolishguy

    The Access database itself will be in a location of the customer's choosing, probably on a server, while the the file holding the path will be relative to the application. I was just concerned about somebody who shouldn't know discovering the location of the database. It's probably not a huge concern because I'll put whatever security measures I can in place to protect the database itself. If they tinkered with the file holding the path, the application will simply not run (or not run correctly). I also plan to allow an authorized user to reset the path to the database (through an application form) should anything change (the location of the database, the file holding the path, etc). Anyway, thanks. I'll try storing the data encrypted.

    C# database security question

  • Path to Access Database
    T thepolishguy

    I want to store the path of an Access database that will be used during my application. When the application loads, it can check the path stored in a file of my choosing and determine whether or not the file is still in the same location. How would you suggest I store the path? A text file seems the simplest way to go, but would provide little or no security. Any suggestions would be appreciated. Thanks.

    C# database security question

  • Changing Screen Resolution through C#
    T thepolishguy

    I want to provide operators of my C# software the opportunity to change screen resolution to optimal settings (1024x768) for viewing this particular software. How do I change screen resolution (and maintain those changed settings), should the user opt to do so? -- modified at 11:08 Tuesday 20th December, 2005 I should have added the following. The computer that will be running the program is, in this case, a dedicated machine. It's purpose is basically to run the software I'm developing. As such, it makes a certain sense to have the display settings optimal for the particular application-should the operator opt to set them that way. The operator is under no obligation to set the computer to those optimal settings and will have the option to not see the message box again after the initial run of the program.

    C# question csharp

  • Thread Management
    T thepolishguy

    I need to read certain data from an external source for the duration of an application's run time. In order to do that, I set up a thread that starts as soon as the first form on the application loads and that will continue to run until that form is null. Now, for most of the application run time, the values that I'm reading from the external source should be static (or nearly so), but the operator of the software will initiate a process (a test) during which the values I need to read will change. Ideally, I would still get those values from the external source from the separate thread, but I encountered some serious reduction in program efficiency when I did that. The test itself runs on its own thread so that the operator can switch between different forms on the application while the test is running. When the test thread and the other thread that runs for the duration of the application were both competing to read from/write to the external source, I had the slowdown mentioned previously. I solved the reduction in efficiency problem by having the test thread suspend the execution of the other thread until it finished its work, but encountered some problems after doing that which aren't obviously related to the thread suspension, but may be the culprit behind the problems I'm encountering. Is there a problem with one thread (not the main thread) suspending and then resuming the execution of a different thread (that is also not the main thread)?

    C# help question

  • Null Reference Exception COM Objects
    T thepolishguy

    I'm getting a Null Reference Exception when using a COM object. The error occurs randomly, or so it seems, with nothing obvious to distinguish the runs when the error occurs and when it does not. As it so happens, the COM object connects to a particular software called Think & DO. When the other software runs on the PC, the COM object works perfectly, but when the other software runs on a Programmable Logic Controller (PLC)-and C# connects via the COM object directly to the PLC, the object is unreliable. Without knowing the details of the COM object, is there any advice someone can give me regarding how to discover the error I'm getting?

    C# csharp com help tutorial question

  • Sharing C# Program While Preserving Data Adapters
    T thepolishguy

    I'm running into a program successfully sharing a C# program with a fellow developer. We're each working on separate aspects of an application on our local drives, but sharing updates via a network. When we upload the C# application from the network, the DataAdapters for our projects need to be reconnected through the 'Configure Data Adapter' despite the fact that we hold the database for the project in the same location on our local drives. Is there a way to avoid that?

    C# csharp database sysadmin question

  • Update Controls While Enabling Others
    T thepolishguy

    I need to update certain controls on a form in C# while a test sequence is performed that lasts up to 90 seconds while keeping a running record on that same form of the test results. Basically, the top half of the form will be the data entry portion of the form with the relevant text and combo boxes while the bottom portion of the form contains the data being tested. Certain labels and text boxes on the bottom part of the form need to be updated as the test progresses, but I need to enable the user to enter new data in the top half of the form. I thought perhaps multi-threading would solve the trick, but would the threads be able to access the same resource, this one form, at the same time?

    C# csharp question announcement learning

  • Update Form while Retaining Access to It
    T thepolishguy

    I need to update a C# form with values read to it from another program in addition to changes from C# code while retaining the ability to edit text/combo boxes on a different part of the form from the updates. Right now, I can get the updates running, but am denied access to the form while the updates are occurring. How can I achieve this functionality?

    C# question csharp announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups