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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

Dave Shaw

@Dave Shaw
About
Posts
8
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Delphi Dlls in C#
    D Dave Shaw

    Thanks Senthil, I have now overcome this problem, however. I am now getting a BroadcastEventWindow.2.0.0.0.33 when I close my application. I am then getting RunTime Error 217 once then getting RunTime Error 216 followed by 'The Memory Could not be "Read"' message in a Continuous Loop until I Kill my Application. Any Ideas? Thanks. Dave Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    C# csharp delphi help

  • Delphi Dlls in C#
    D Dave Shaw

    Hi, I have a Delphi 6 DLL that I need to run from C#.Net 2.0. I have some problems with it though. Here Goes: The Delphi Decalration is : function M_Login(ip : PChar; port : LongInt; uci : PChar; vol : PChar; pass : PChar; user : PChar) : LongInt; stdCall; And the C# Declaration is : [DllImport("iMSMAPI.DLL", CallingConvention = CallingConvention.StdCall, CharSet=CharSet.Ansi)] private static extern Int64 M_Login(string ip, Int64 port, string uci, string vol, string pass, string user); This gives me an AccessViolationException at RunTime when I call M_Login. I can Change the Delphi Declaration to expect Strings instead of PChars, this avoids the AccessViolationError, but this causes the values passed to the Delphi DLL to be incorrect. i.e. contain characters that the C# Application did not pass. I passed the value "127.0.0.1" as the ip parameter in C# and when I inspected the ip parameter in Delphi it was '1'#0'2'#0'7'#0'.'#0'0' . Can anyone help. Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    C# csharp delphi help

  • C# 1byte-1char strings
    D Dave Shaw

    Hi, Does anyone know an easy way to create a string of characters that are assigned 1 byte for each character, in C#. I am interfaceing with a rather old API (written in ANSI C, think) from .NET 2005 (beta). The problem is that the normal c# string data type uses unicode encoding, this allocates atleast 8 bytes per char. I have a Delphi 6 interface for the API that uses PCHAR data type, instead of string, and this works OK. Also, will I need to declare the API calls with a data type that uses 1 byte per char, instead of just string? P.S. this is the MSMAPI32.DLL to connect to Micronetics MSM (MUMPS). Incase there are any MUMPSTER's out there.:-O Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    C# csharp delphi beta-testing json

  • pre-school
    D Dave Shaw

    Hi there, Can you please let me know some more info and I will see what I can do. If you want you can send me an E-Mail. Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    Web Development com help tutorial

  • Newbie HyperLink query
    D Dave Shaw

    Hi Paul, Try adding this to the start of your code: <!-- function open_window(url) { var NEW_WIN = null; NEW_WIN = window.open (url, "Page Title", "toolbar=no,"+ "width=500"+ ",height=250"+ ",directories=no,status=no,"+ "scrollbars=yes,resize=no,menubar=no"); //NEW_WIN.location.href = url; } //--> and then using making the server write: [to call it. Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris](javascript:open_window('MyPage.aspx?args=values');)

    ASP.NET javascript database question

  • help me plz
    D Dave Shaw

    Here Here. Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    C# help tutorial

  • SHA-2, is it in .NET?
    D Dave Shaw

    Hi, I have been looking into implementing SHA-2 Hashing into my application, but I am unsure if it is available in the .NET Framework. I have read conflicting info on the Net; some says that the SHA256, 384 and 512 are different bit strenght versions of SHA-1 and some say SHA-2. If not does anyone have a C# implementation of SHA-2? Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    .NET (Core and Framework) csharp dotnet question

  • Encryption/Decryption
    D Dave Shaw

    Hi, If you want to store a password in database, I suggest you use a 'One-Way Hash' algorythm. These are un-reversable encryption algorythms, hence the name one-way. Then you follow these steps to authenticate your users: 1. User Registers, Username and Hashed Password are stored in DB. 2. User types in Username and Password. P = password 3. The Software encrypts the Users Password with a One-Way Hash. P1 = Hash(P) 4. The Software queries the database and finds the password of the user (Storing Hashed in the database). P2 = database_pass 5. If the Hashed Pass in the DB and Hashed Pass the user typed in Match, Allow Login. If P1 == P2 then Login else Fail (remeber P1 = Hash(P)) Try this code to generate a one-way hash of a password. ------------------------------------------------------------------------------- private Byte[] GetByteArray( String originalString ) { Char[] charArray = originalString.ToCharArray(); Byte[] byteArray = new Byte[charArray.Length]; for ( int i=0; i /// Creates a one-way SHA1 hash of the pt string /// /// Plaintext to Hash /// Ciphertext string public string Hash(string pt) { //Implement SHA1 Hashing Algorythm (40 Bytes / 320 bits) byte[] data = new byte[40]; byte[] hash = new byte[40]; while (pt.Length % 4 != 0) pt += "g"; data = Convert.FromBase64String(pt); SHA1 sha = new SHA1CryptoServiceProvider(); hash = sha.ComputeHash(data); return Convert.ToBase64String(hash); } ------------------------------------------------------------------------------- Thanx! Dave Shaw History admires the wise, but elevates the brave. - Edmund Morris

    C# database security regex 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