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
K

Kiotaya

@Kiotaya
About
Posts
13
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How can I convert a Class to byte[] then back to Class for Windows Mobile? [modified]
    K Kiotaya

    I have a class that I need to convert to a byte array for a Windows Mobile device. The byte array is sent using ssl to a server, which needs to rebuild the class. I have used BinaryFormatter on a PC client that worked great. However I can't use that with the compact framework. This is the code I am currently trying to use but its giving me the error message "Type 'PackageTrans' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.".

    public byte[] ClassToBytearray(object obj)
    {
    int Length = Marshal.SizeOf(obj); <----------This is where I get the error.
    byte[] bytearray = new byte[Length];
    IntPtr ptr = Marshal.AllocHGlobal(Length);
    Marshal.StructureToPtr(obj, ptr, false);
    Marshal.Copy(ptr, bytearray, 0, Length);
    Marshal.FreeHGlobal(ptr);
    return bytearray;
    }

    This is my first time using Marshal. Why wouldn't a meaningful size or offset be computed? What is it that I am missing? Is there a different way I should be doing this? Any and all help would be greatly appreciated. Thanks -Kio

    modified on Friday, June 11, 2010 1:25 AM

    Mobile question help sysadmin data-structures security

  • OpenSSL.NET Tutorial? [modified]
    K Kiotaya

    I found out that this dll does not work with Windows Mobile SDK. The dll refrences System.Net.Authentication which is not part of WCF. Does anyone know of a way to use SSL with Windows Mobile that is not using Http?

    C# tutorial csharp sysadmin security help

  • OpenSSL.NET Tutorial? [modified]
    K Kiotaya

    This was not what I was looking for but thank you for the response.

    C# tutorial csharp sysadmin security help

  • OpenSSL.NET Tutorial? [modified]
    K Kiotaya

    Hello, I am writing a client app for Windows Mobile 6.5. This app will need to communicate using ssl to a server app. For the ssl I am using ManagedOpenSsl.dll that came with OpenSSL.NET. I have not figured how to use this dll to make an ssl connection. Does anyone have a link to a tutorial that can help me with this? Thanks in advance Kiotaya

    modified on Tuesday, March 2, 2010 7:20 PM

    C# tutorial csharp sysadmin security help

  • LRC calculation... What did I miss? [modified] Solved
    K Kiotaya

    Sorry I didn't reply to this much sooner but the help you game me help me clear up this problem. Thanks Luc Pattyn and everyone else.

    C# sysadmin security help question

  • LRC calculation... What did I miss? [modified] Solved
    K Kiotaya

    I am going to be running some more tests today. I will give you more details this afternoon. Thank you very much for your help and time.

    C# sysadmin security help question

  • LRC calculation... What did I miss? [modified] Solved
    K Kiotaya

    Thank you for your response Luc. However it looks like what you are telling me is what I did in the second example I show. Please correct me if I am wrong in this assumtion. Here is the second example. RequestMessage contains Message+ETX only

    public static char theReturnLRC(string RequestMessage)
    {
    int lrcAnswer = 0;
    byte[] byArray = Encoding.UTF7.GetBytes(RequestMessage);

     foreach (byte curByte in byArray)     
     {                 
       lrcAnswer ^= curByte;     
     }             
       return (char)lrcAnswer;
    

    }

    char charLrc = ReturnLRC(Trans);
    string lrcString = charLrc.ToString();
    byte[] LRC = unicode.GetBytes(lrcString );
    fullMessage[addLRCHere] = LRC[0];

    C# sysadmin security help question

  • LRC calculation... What did I miss? [modified] Solved
    K Kiotaya

    I need to get the LRC (longitudinal redundancy check) value of a string. This data is being sent to a credit card processing network over SSL. After I get the LRC I am coverting it to string, then to a byte, and adding it to the end of a byte[] to send through SSL. When I send the transaction I am getting a NAK response to my LRC. What am I doing wrong? I have tried this RequestMessage contains Message+ETX only

    public static char ReturnLRC(string RequestMessage)
    {
    int lrcAnswer = 0;
    for (int i = 0; i < RequestMessage.Length; i++)
    {
    lrcAnswer = lrcAnswer ^ (Byte)(Encoding.UTF7.GetBytes(RequestMessage.Substring(i, 1))[0]);
    }
    return (Char)lrcAnswer;
    }

    char charLrc = ReturnLRC(Trans);
    string lrcString = charLrc.ToString();
    byte[] LRC = unicode.GetBytes(lrcString );
    fullMessage[addLRCHere] = LRC[0];

    I have also tried this seperatly. RequestMessage contains Message+ETX only

    public static char theReturnLRC(string RequestMessage)
    {
    int lrcAnswer = 0;
    byte[] byArray = Encoding.UTF7.GetBytes(RequestMessage);

     foreach (byte curByte in byArray)
     {
                 lrcAnswer ^= curByte;
     }
             return (char)lrcAnswer;
    

    }

    char charLrc = ReturnLRC(Trans);
    string lrcString = charLrc.ToString();
    byte[] LRC = unicode.GetBytes(lrcString );
    fullMessage[addLRCHere] = LRC[0];

    Neither process works, are the methods incorrect or is my conversions afterwards messing everything up? Thanks in advance for any help or advice. Removing all the conversion confusion I found that I was generating the correct LRC. Thanks Everyone!!! Kiotaya

    modified on Monday, November 16, 2009 10:57 AM

    C# sysadmin security help question

  • Multiple data sources with the same name in different directorys? [modified]
    K Kiotaya

    Thanks but I figured it out myself. -You can't have one connection to many databases. (At least with Access.)- -How about a Dictionary of connections?- -Otherwise you'll need to explain what you need more clearly.- By using the "xxx.exe.config" file you can change the directory your connection is pointing to. This way I do not have to recompile code everytime I want to add a merchant.

    C# help question csharp database tutorial

  • Multiple data sources with the same name in different directorys? [modified]
    K Kiotaya

    That will not work. I need to know how to switch between databases programatically. All the databases have the same name and tables. Also I may be adding more merchants in the future. I do not want to have to go back and recompile the code everytime I add another merchant. I would appreciate it of someone could help me with this or point me in the direction of an article that may help answer this. Thanks Kio

    C# help question csharp database tutorial

  • Multiple data sources with the same name in different directorys? [modified]
    K Kiotaya

    Thank you for your response but neither of these options are practicle. I need to be able to programaticlly switch from one database to another.

    C# help question csharp database tutorial

  • Multiple data sources with the same name in different directorys? [modified]
    K Kiotaya

    Im sorry, I should have explained the name "House" is an example. The actual database name is "Merchant". How do I switch from Access database in folder A to Access database in folder B?

    C# help question csharp database tutorial

  • Multiple data sources with the same name in different directorys? [modified]
    K Kiotaya

    Hello, I am new to C# and I writing an application that uses an Access database. It works fine I can do almost everything I need to do with that database. The database represents one object, lets say "House" for example. The tables represent the different rooms in the house. The items in each room fill the cells in the table. The problem I am having is that there are several databases "houses", each in their own directory. They each have the same file name. The databases identical except for the data. I want to be able to switch back and forth through them. How can I programatically switch from one Access database in folder A to another Access database in folder B? "House" database name and "Room" tables are just an example. Any and all help would be greatly appreciated. Thank you Kio

    modified on Friday, July 24, 2009 9:42 PM

    C# help question csharp database tutorial
  • Login

  • Don't have an account? Register

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