Get Away With Packing Data Into Serialized Objects?

Feb 24, 2011

I have a thought about using a Serializable Collection containing both data objects and also sub-collections as a low-grade database, meaning it's going to store data objects that are expected to be added to regularly and deleted from occasionally.

View 3 Replies


ADVERTISEMENT

Can Objects With Null Values Be Serialized

Dec 27, 2011

I have used XML serialization to persist objects in my application but I am now interested in using null- able Data types for properties. Will I still be able to serialize?

View 6 Replies

Tcp/ip - Consecutive Serialized Objects Not Deserializing?

Mar 28, 2009

This is my first post on here--I've been teaching myself VB via forums like this and MSDN for about 2 years now. I'm programming a computerized economics experiment, and I'm using a communications package that a guy I worked with developed. He and I have been going back and forth trying to figure out what the heck is going on.

The upshot of the communications package is that there's a serializeable MQMessage class that we send back and forth, essentially just a package of an integer (Type), string (Text), and Object (Data). Most of the time, this goes according to plan.

The problem is this: If the client receives two or more messages back-to-back, the client stops raising the MessageArrived event. (and presumably, the same would hold true for the server--I should test this, but jeez-oh-man, I've been running test after test for the last week).It's still connected, as on disconnect it throws the "Socket forcibly closed" exception. When it receives multiple messages sequentially, it's still receiving the data, it just never knows when the first message ends, and the buffer just keeps filling and filling. The problem seems to be that it can never successfully Deserialize the MQMessage object, and so it returns Nothing on the getCompletedMessage function and just keeps adding to the buffer (ABuffer.Length goes 1024, 2048, etc.).

View 1 Replies

Changing Datatypes Of Properties Of Serialized Objects?

Jun 18, 2009

Changing datatypes of properties of serialized objects?

View 1 Replies

Send And Receive Serialized Objects Over A TCP Connection

Jun 7, 2010

How can I send and recieve serialized objects over a TCP connection with size and data type values in the header (within array(0) and array(1) values)?I know how to serialize and send the object using BinaryFormatter.Serialize.I dont know how to take the recieved data and put it into an array of bytes().Also - on the receiving end I dont know the size of the object sent therefore I dont know when to stop reading the data stream so I cant use: Dim Obj As ClassName = DirectCast(BinaryFormatter.Deserialize(Stream), ClassName).

View 1 Replies

Encrypting Serialized Data Files?

Feb 26, 2009

i would like to encrypt my data files, which are serialized object files. is there a simple way to do this that will work trouble free on both windows xp and vista?

my environment: windows xp pro (sp3), visual studio 2008 pro, (sp1, sdk 1.1)

View 2 Replies

Packing .exe Into Program?

Oct 20, 2009

I tried using MoleBox pro, it woulnd't even start, how would I pack some files with the .exe so that when i type something like shell "drum.exe" it will run drum .exe? But drum.exe wont be out in the open.

View 2 Replies

Creating, Packing And Unpacking .zip Files In .NET?

Aug 7, 2010

I am planning on sending some of my friends and colleagues a copy of a program that I made. For this program I was going to include a .zip file of some extras for them to look at. Is there a way in VB.NET to create a .zip folder, copy things from the program's resources into the .zip folder, and then later on be able to unpack them? PS - The purpose of this is to copy items from the resources into the .zip folder so that I can send everything in one program.

View 10 Replies

Packing PictureBox MouseEnter Events Into One

Dec 9, 2011

I wonder if I can pack the following MouseEnter events into one.

[Code]...

Onion is a recent refuge from Mac OS X and hates Mac App Store. System: Windows 7 x64

View 2 Replies

Rounding Up Quantity And Packing Variables

Aug 2, 2010

I am trying to round-up in VBscript but am hitting blanks...
My script so far is...
Value = Quantity / Packing
Value = Int(value + 0.8)
Quantity and Packing are variables and always needs to round up.

View 1 Replies

VS 2008 Packing / Unpacking Different Archives

Jul 24, 2010

I just wanted to ask, if it's possible unpack or pack different archives like .iwd with winrardll, as winrar opens them without problems, and makes them as easy as opening them If it's possible, would process be the same, just with .iwd extension? If it isn't, is there any other way to do it?

View 1 Replies

C# - .NET 3/4 Permits Events To Be Binary De/Serialized?

Feb 25, 2010

In .NET (at least <=2) there's a problem serializing objects that raise events when those events are handled by a non-serializable object (like a Windows Form).Because of the way VB.NET implements events, when you serialize an object, its events get serialized too (because events are actually implemented using hidden multicast delegate fields). A side effect of this is that any object which handles events raised by the object being serialized will be considered part of the object graph and will be serialized too.

Some workarounds could be found, implementing custom serialization or using delegates instead of events:[URL]..

View 1 Replies

Creating Serialized Picture Boxes

Dec 27, 2010

I'm building a simple game which involves many pictureboxes with which the player may collide. For instance, I'd have a hundred bricks spread throughout the level. In an old version of pacman I built in VB6 (and upgraded to .net), I implemented this like so: [Code]

As I understood, the brick(I) array exists thanks to the naming of the bricks, which ranges from _brick_0 to _brick_217 (as nowhere in the project a brick array is declared implicitly, at least not that I could find). I'd like to do the same in my current project, but even when I duplicate an existing brick it automatically renames it to "PictureBox123" instead of _ExistingName_NextID.

I saw a method of declaring a picturebox array and adding the bricks one by one, but since I have so many pictures this would best be avoided (especially due to the fact that not all pictures are bricks, so I cant just loop through every picture in the form). In short, my question is: How do I duplicate pictureboxes so that they'd be serialized in a way vb.net would interpret as a picturebox array? As you can see, i'm a really newbie to vb.net and wf in general, just started studying wf a couple days ago for my B.Sc and even that was accomplished with c#.

View 1 Replies

Format Property Serialized Using Xml.serialization?

Sep 26, 2011

I have created a class from an xml schema (that I do not own and cannot change) using xsd.exe. Using this class, I am deserializing to bring the data in to an object collection to consume. There are times when I want to take objects in memory and pass them to the class created by xsd.exe using a constructor I built to generate a serialiable object collection.

I cannot figure out how to format some objects correctly Example: In the xml file, there are certain simple types that are floats that come in with 6 digits of precision. When I write them out, they have 7 digits of precision. Anorther example is integers with leading zeros in the xml file. They come in as 4 digits regardless of leading zeros, but I can't find a suitable way using serialization to output them (other than to change the property to a string datatype.[code]...

View 4 Replies

Removing XML Namespaces From XML Serialized Output

Feb 17, 2010

I am generating this XML using the serializer in VB.net as shown below

Dim string_writer As New StringWriter()
Dim serializer As New XmlSerializer(GetType(MyClass))
serializer.Serialize(string_writer, addr)
txttest.Text = string_writer.ToString()

though it is returning XML, I see xmlns="http://tempuri.org/ in all the elements, is there anyway I hide this one.

View 1 Replies

Send Serialized Object Over TCP Stream?

Jun 7, 2010

How can I send and recieve serialized objects over a TCP connection with size and data type values in the header (within array(0) and array(1) values)?

I know how to serialize and send the object using

BinaryFormatter.Serialize

But on the receiving end I dont know the size of the obejct sent therefore I dont know when to stop reading the data stream. I also dont know how to take the recieved data and put it into an array of bytes().

View 2 Replies

Serialized Xml Settings File Nodes

Nov 10, 2010

[Code]...

I am using this to load settings files, but if a piece is missing, then the whole thing fails. What can I use to load each node individually instead?

View 3 Replies

Control The Element Names Of Serialized Subclasses?

Jul 5, 2011

Let's say I have the following class structure (simplified from my real-world problem):

Public Class PC_People_Container
Private _people_list As New List(Of PL_Person)
Public Sub New()[code].....

If I were to serialize this, I'd get the default assigned node names in my XML. That means my root is named PC_People_Container and each person in the list is marked up as PL_Person. I know I can change the root node using <XmlRoot(ElementName :="PeopleContainer")>. The trouble is doing that for the subclasses. I can't use the <XmlRoot> tag on PL_Person class because there can't be two root elements, and IntelliSense throws a fit when I try to use the <XmlElement> tag on a class like I would on a property. Is it even possible to control what those subclasses are named when they're serialized as child nodes?

View 1 Replies

C# - Requirments For ISupportInitialize Code To Be Serialized In InitializeComponent?

Apr 26, 2010

I need to add some code to the EndInit method of a PictureBox control but unfortunately its private and, from what I can gather, I can't shadow it and call base - at least not in VB.Net.What I can do is add a dummy property to my picture box class. The type of the dummy property is simply a class that just implements ISupportInitialize. However, that doesn't work, I need the dummy class to inherit from Control.Is that the minimum requirement?

View 1 Replies

Encrypt And Decrypt A Serialized Text File?

Aug 14, 2010

For example I got this part of a method which serializes a textfile with a password and then encrypts it using the rijndael encryption method[code]...

View 8 Replies

Send A XML Serialized Class Over A Network Stream?

Oct 13, 2009

I'm trying to send a XML serialized class over a network stream

the send is working

Dim IP As Net.IPAddress = System.Net.IPAddress.Parse(IPAddress)
Dim IPE As New Net.IPEndPoint(IP, 10003)
Dim TCPClient As New Net.Sockets.TcpClient

[Code]....

I always get an error {"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."} The XMLFile has the xml document in it most of the time and I can go on and everything works but 1 out of every 5 times it doesn't work at all and the XMLFile contains nothing ..

View 6 Replies

VS 2010 : Writing Serialized Object To File?

Apr 6, 2010

I have a class like this:

<Serializable()> Public Class GOODownloadFile
Private aID As String
Private aDownloadLink As String

[code]....

Now when I create an object like this

Dim f As New GOODownloadFile("http:\download.com1.exe", "c:Down", "c:Down")
downloader.AddDownloadFile(f)
downloader.WriteInfoFile("C:1.txt")

All the values given are correctly saved in the file 1.txt But when I change the download file info afterwatds, like this:

Dim f As New GOODownloadFile("http:\download.com1.exe", "c:Down", "c:Down")
downloader.AddDownloadFile(f)
downloader.WriteInfoFile("C:1.txt")

[code]....

the new value (123456) is not saved. Hence, only the values provided BEFORE the AddDownload are saved, the rest aren't.
I've check my code 100times, and I'm sure everything is fine. I think it may be because of the send-by-value. When I change the values afterwards, the orginal object isn't used.

View 4 Replies

VS 2010 Creating Serialized Picture Boxes?

Dec 27, 2010

I'm building a simple game which involves many pictureboxes with which the player may collide. For instance, I'd have a hundred bricks spread throughout the level. In an old version of pacman I built in VB6 (and upgraded to .net), I implemented this like so:

[Code]...

View 2 Replies

VS 2010 Encrypting A Serialized Object Or Stream?

Mar 7, 2011

Basically, I need to transmit data across a network from point A to point B using a Binary Serialization System. I'm doing this to make sure that the system can't have outside listeners read the data being sent easily and to keep results secure and confidential.What is an easy way that I can encrypt, say, a generic object? Would it be easiest to serialize it to file, read the bytes in, encrypt the bytes, then store the bytes in a serialized structure and send that across the stream and reverse the process?

Private Function EncryptClass(ByVal obj As Object) As Byte()
Dim key() As Byte = {52, 15, 85, 150,
45, 12, 78, 120,

[code].....

View 6 Replies

.net - Do Classes Serialized As Object Lose Their Type Information

Apr 2, 2012

I have a serializable Message class that has a Data As Object property that I'm using as a generic holder for information to be sent via a system that uses a combination of push technology and/or IPC to communicate with any other programs that are interested in the information. This allows the communication piece to be agnostic of the information it transmits.

I was serializing this Data As Object as a Byte[], since I was worried about how an Object being serialized and transmitted across the network would behave on the other side. However, when deserializing I get errors about being unable to find the assembly for the types stored within my Data As Object property, because I'm deserializing in the assembly that contains the Message class... not the assembly that contains the type that Data As Object originally was.I was wondering if I'd lose the type information and be unable to cast it back to the type I want at the other end. Perhaps it's not possible to pass a type as an Object via another assembly without it knowing about my type?

View 2 Replies

.net - SerializationException, Avoid UserControl Consuming An Event To Be Serialized?

Aug 3, 2011

I attempt to serialize an object, and it throws an exception as shown below. I assume it attempts to serialize also the UserControl that subsribes to an event of the class I try to serialize. This is not desired. So how do I avoid serializing events?

SerializationException occured:Type 'System.Windows.Forms.UserControl' in Assembly'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' is not marked as serializable.

[code]....

View 4 Replies

Printing A Serialized Barcode Label To A Zebra Printer?

Jun 15, 2011

trying to create a WPF application that will allow users to print a barcode label written in ZPL that is saved to a text file on the C: drive. I am able to print the barcode with the WPF Application except it prints the same serial # without incrementing to the next one. I would like have the application:Open the test.txt file and read the last serial # that was printed. Print the next serial #. Write the last serial # it printed to the file for the next it is printed so that if I printed 1,2,3 this time, the next time it would print 4,5,6. Below is my code for the test.txt file and my VB.net code.

test.txt
^XA
^LH20,10^AE^FDBUILD LABEL^FS

[code]....

The printing process doesn't look pretty, but I was unable to get it to print with PrintDocument.Print() and I could by using a Process. I am guessing the issue is with intSN declaration not appending the serial # back to the test.txt file, instead, it adds
the barcode back to the file.

View 6 Replies

Connecting To Data In Objects?

Jan 23, 2008

I am currently working my way through a MSDN Walkthrough titled Connecting to Data in Objects, the link for this is

[URL]

I have worked up to the section Adding Code to Load Data into the Customer and Order Objects section with no problems, but the Public Class Form 1 code is throwing an error hilighted in italics as per below,

Private Sub LoadOrders(ByRef currentCustomer As Customer) Dim orderData As NorthwindDataSet.OrdersDataTable = _ OrdersTableAdapter1.GetDataByCustomerID(currentCustomer.CustomerID)

This is the Description returned from the error list,

Error 1
Description - Value of type 'ObjectBindingWalkthrough.NorthwindDataSet.OrdersRow' cannot be converted to 'ObjectBindingWalkthrough.NorthwindDataSet.OrdersDataTable'.

[code]....

In the walkthrough I also came across a problem under the heading Modifying the Query on the OrdersTableAdapter to Return Only Orders for the Desired Customer This SQL throws an error,

SELECT OrderID, CustomerID, EmployeeID, OrderDate,
RequiredDate, ShippedDate, ShipVia, Freight,

[code]....

But the following edit to the Where clause gets around the error, the @ symbol is removed,WHERE CustomerID = CustomerIDcould this be causing the problems I am having described above, or is this just an error.

View 5 Replies

Put Data Into An Array Of Objects?

Jan 29, 2009

This is getting on my nerves. All the examples I keep finding deal with Consoles, all I'm trying to do is put data into an array of objects and output them into a Text box, but I don't know the syntax to do that.Here's my class

Public Class Student
Private SID As Integer
Private firstName As String

[code]......

View 5 Replies

WCF Data Objects Best Practice

Mar 24, 2011

I am in the processing of migrating from web services to WCF, and rather than trying to make old code work in WCF, I am just going to rebuild the services. As a part of this process, I have not figured out the best design to provide easy to consume services and also support future changes.

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved