Click here to Skip to main content
16,019,514 members
Home / Discussions / C#
   

C#

 
AnswerRe: In _keyDown I don't receive events for the arrows keys Pin
I Believe In GOD5-Jun-09 22:45
I Believe In GOD5-Jun-09 22:45 
AnswerRe: In _keyDown I don't receive events for the arrows keys Pin
DaveyM695-Jun-09 23:49
professionalDaveyM695-Jun-09 23:49 
GeneralRe: In _keyDown I don't receive events for the arrows keys Pin
I Believe In GOD6-Jun-09 10:36
I Believe In GOD6-Jun-09 10:36 
GeneralRe: In _keyDown I don't receive events for the arrows keys Pin
Roland Szigeti6-Jun-09 10:45
Roland Szigeti6-Jun-09 10:45 
QuestionSmart Card Reader/Writer Pin
ddravin20005-Jun-09 21:45
ddravin20005-Jun-09 21:45 
AnswerRe: Smart Card Reader/Writer Pin
Garth J Lancaster5-Jun-09 22:09
professionalGarth J Lancaster5-Jun-09 22:09 
QuestionExecute query in server Pin
Abdul Rahman Hamidy5-Jun-09 21:44
Abdul Rahman Hamidy5-Jun-09 21:44 
QuestionSerializing objects in c# Pin
alonchap5-Jun-09 21:44
alonchap5-Jun-09 21:44 
Hi All,
i created a painter program, with classes and all shapes.
i save the shapes in arraylist for undo redo.
i tried to serialize the objects using the following code,
just to see if it works, and i get error

using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Collections; // for using ArrayList to save shapes
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PaintBrush
{
    public class SaveBinary
    {
        // Create file to save the data
        FileStream fs = new FileStream("Data", FileMode.Create);
        // Create binary formatter object:
        BinaryFormatter BF = new BinaryFormatter();
        BF.Serialize(fs, "1234");
        fs.Close();
    }
}


it won't recognize BF at all, and i don't see why (using visual studio 2008)
Error on compile:

C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\PaintBrush\PaintBrush\Serialize.cs(23,21): error CS1519: Invalid token '(' in class, struct, or interface member declaration
C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\PaintBrush\PaintBrush\Serialize.cs(23,24): error CS1519: Invalid token ',' in class, struct, or interface member declaration
C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\PaintBrush\PaintBrush\Serialize.cs(24,17): error CS1519: Invalid token '(' in class, struct, or interface member declaration

Compile complete -- 3 errors, 0 warnings
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks,
Retaliator
AnswerRe: Serializing objects in c# Pin
Christian Graus5-Jun-09 21:55
protectorChristian Graus5-Jun-09 21:55 
GeneralRe: Serializing objects in c# Pin
alonchap5-Jun-09 22:21
alonchap5-Jun-09 22:21 
GeneralRe: Serializing objects in c# Pin
Christian Graus5-Jun-09 22:52
protectorChristian Graus5-Jun-09 22:52 
GeneralRe: Serializing objects in c# Pin
alonchap5-Jun-09 23:00
alonchap5-Jun-09 23:00 
GeneralRe: Serializing objects in c# Pin
Christian Graus5-Jun-09 23:35
protectorChristian Graus5-Jun-09 23:35 
GeneralRe: Serializing objects in c# [modified] Pin
alonchap6-Jun-09 7:09
alonchap6-Jun-09 7:09 
QuestionC# and C++ Win32 Console app Interop Pin
indikat5-Jun-09 21:18
indikat5-Jun-09 21:18 
AnswerRe: C# and C++ Win32 Console app Interop Pin
Garth J Lancaster5-Jun-09 21:37
professionalGarth J Lancaster5-Jun-09 21:37 
GeneralRe: C# and C++ Win32 Console app Interop Pin
indikat6-Jun-09 1:04
indikat6-Jun-09 1:04 
GeneralRe: C# and C++ Win32 Console app Interop Pin
Garth J Lancaster6-Jun-09 14:59
professionalGarth J Lancaster6-Jun-09 14:59 
GeneralRe: C# and C++ Win32 Console app Interop Pin
indikat6-Jun-09 18:56
indikat6-Jun-09 18:56 
GeneralRe: C# and C++ Win32 Console app Interop Pin
Garth J Lancaster6-Jun-09 19:56
professionalGarth J Lancaster6-Jun-09 19:56 
GeneralRe: C# and C++ Win32 Console app Interop Pin
indikat7-Jun-09 5:01
indikat7-Jun-09 5:01 
Questionnews management system Pin
harispa5-Jun-09 21:06
harispa5-Jun-09 21:06 
AnswerRe: news management system Pin
Christian Graus5-Jun-09 21:55
protectorChristian Graus5-Jun-09 21:55 
QuestionAdding datagridview columns Pin
michaelgr15-Jun-09 20:27
michaelgr15-Jun-09 20:27 
AnswerRe: Adding datagridview columns Pin
MickCurley5-Jun-09 21:28
MickCurley5-Jun-09 21:28 

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.