Click here to Skip to main content
16,006,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Running a C# application from a network drive Pin
Heath Stewart10-Jan-05 19:35
protectorHeath Stewart10-Jan-05 19:35 
GeneralCharacter conversion in .NET Pin
Paul Selormey10-Jan-05 15:08
Paul Selormey10-Jan-05 15:08 
GeneralRe: Character conversion in .NET Pin
Heath Stewart10-Jan-05 19:42
protectorHeath Stewart10-Jan-05 19:42 
GeneralRe: Character conversion in .NET Pin
Paul Selormey10-Jan-05 21:58
Paul Selormey10-Jan-05 21:58 
GeneralRe: Character conversion in .NET Pin
Heath Stewart11-Jan-05 4:55
protectorHeath Stewart11-Jan-05 4:55 
GeneralRe: Character conversion in .NET Pin
Paul Selormey11-Jan-05 5:46
Paul Selormey11-Jan-05 5:46 
GeneralRe: Character conversion in .NET Pin
Heath Stewart11-Jan-05 7:14
protectorHeath Stewart11-Jan-05 7:14 
GeneralRe: Character conversion in .NET Pin
Paul Selormey11-Jan-05 11:30
Paul Selormey11-Jan-05 11:30 
Heath Stewart wrote:
Or are you saying that you'll just duplicate what it does. I've done this for an old project for a GetDeviceCaps wrapper.

That is the simply story. Smile | :)
public static char Chr(int CharCode)
{
    if ((CharCode < -32768) || (CharCode > 0xffff))
    {
        throw new ArgumentException();
    }
    if ((CharCode >= 0) && (CharCode <= 0x7f))
    {
        return Convert.ToChar(CharCode);
    }

    int nTemp;
    Encoding enc = Encoding.GetEncoding(932);
    if ((enc.GetMaxByteCount(1) == 1) && ((CharCode < 0) || (CharCode > 0xff)))
    {
        throw new InvalidOperationException();
    }
    char[] chTemp = new char[2];
    byte[] buffer = new byte[2];
    Decoder decoder = enc.GetDecoder();
    if ((CharCode >= 0) && (CharCode <= 0xff))
    {
        buffer[0] = (byte) (CharCode & 0xff);
        nTemp = decoder.GetChars(buffer, 0, 1, chTemp, 0);
    }
    else
    {
        buffer[0] = (byte) ((CharCode & 65280) / 0x100);
        buffer[1] = (byte) (CharCode & 0xff);
        nTemp    = decoder.GetChars(buffer, 0, 2, chTemp, 0);
    }

    return chTemp[0];
} 


Best regards,
Paul.


Jesus Christ is LOVE! Please tell somebody.
GeneralGet access to an object during runtime from its process Pin
Dany McCarthy10-Jan-05 13:42
Dany McCarthy10-Jan-05 13:42 
GeneralRe: Get access to an object during runtime from its process Pin
Heath Stewart10-Jan-05 20:01
protectorHeath Stewart10-Jan-05 20:01 
GeneralRe: Get access to an object during runtime from its process Pin
Dany McCarthy11-Jan-05 14:50
Dany McCarthy11-Jan-05 14:50 
GeneralStock Market Simulation Pin
8raker10-Jan-05 13:00
8raker10-Jan-05 13:00 
GeneralRe: Stock Market Simulation Pin
Colin Angus Mackay10-Jan-05 13:46
Colin Angus Mackay10-Jan-05 13:46 
GeneralRe: Stock Market Simulation Pin
8raker11-Jan-05 1:17
8raker11-Jan-05 1:17 
GeneralRe: Stock Market Simulation Pin
Colin Angus Mackay11-Jan-05 1:52
Colin Angus Mackay11-Jan-05 1:52 
GeneralSyncronize Windows Forms DataGrid with DataSet Pin
epinaud10-Jan-05 11:01
epinaud10-Jan-05 11:01 
GeneralRe: Syncronize Windows Forms DataGrid with DataSet Pin
Heath Stewart10-Jan-05 19:54
protectorHeath Stewart10-Jan-05 19:54 
Generalproblem in opening a web application project Pin
panky_710-Jan-05 10:56
panky_710-Jan-05 10:56 
GeneralRe: problem in opening a web application project Pin
panky_710-Jan-05 12:02
panky_710-Jan-05 12:02 
GeneralRe: problem in opening a web application project Pin
Heath Stewart10-Jan-05 20:03
protectorHeath Stewart10-Jan-05 20:03 
GeneralRe: Missing / searching 2nd DataItem as independant index in list/combobox Pin
Rob Graham10-Jan-05 10:56
Rob Graham10-Jan-05 10:56 
GeneralDeleting a Row from a DataSet in a DataGrid Pin
joschmo8010-Jan-05 9:08
joschmo8010-Jan-05 9:08 
GeneralRe: Deleting a Row from a DataSet in a DataGrid Pin
DougW4810-Jan-05 15:36
DougW4810-Jan-05 15:36 
GeneralRe: Deleting a Row from a DataSet in a DataGrid Pin
Heath Stewart10-Jan-05 20:09
protectorHeath Stewart10-Jan-05 20:09 
GeneralRe: Deleting a Row from a DataSet in a DataGrid Pin
joschmo8011-Jan-05 1:56
joschmo8011-Jan-05 1:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.