Set Up A CLASS To Represent A Data Stream?
Apr 1, 2009
I'm trying to set up a CLASS to represent a data stream.This is a newbie question so if the answer is obvious, please excuse me.Several of the data items are multiples which I would normally represent as an Array element.For example, in the code below, the element SolarNameplate has up to 10 instances, so I'd like to use array notation.I get errors, and it doesn't work, so I assume I can't do it like below.
QUESTIONS : 1 - is it possible to use an array element in a class ?
2 - is there another way to achieve what I want ?
Public Class SM1PS01
Private _Projid As String '... name or number of project
Private _LogoFile As String '... file containing customer logo[code]...........
View 18 Replies
ADVERTISEMENT
May 25, 2012
in an winForm app in VS2010 win 7 compiling to x86, I try to do what Alvas.Audio seems to work. See (c# ex: [URL] for reference.
Dim data() As Byte = wr.ReadData(second * i, second)
The result give me data.length()=0. I do not have any exception, I can read format from it and whatever reader I use I got this problem.EDIT : After some tests, it seems like the uncompressed file I create in the first step (in PCM format, with .wav extension) can not be recognized by the Alvas.audio library for the second step. I must miss something around Audio file markups or something alike.
Here is the code that might be the source (basically this is step 1):
Dim functOut As String = String.Empty
Dim wr As Alvas.Audio.IAudioReader = Nothing
Dim fs As IO.FileStream = Nothing
[code]....
How can I write the resulted stream to be sure I can read it again later?
View 1 Replies
May 31, 2011
I'm creating a program that outputs Quotations (and other information relating to these 1. What is the BEST way to read/write from a database (I only really know how to use Access but if XML or SQL would be better, I'm willing to learn). The database needs to be stored and accessed from the same state every time that the program opens. I've tried multiple different ways, both through DataAdapters (in code) to doing it through connecting the database through the Visual Studio GUI. Neither have seemed to work. Other people have told me that using DataAdapters and such aren't the best way, but no one has been able to tell me what this 'best way' is. Also, I need to somehow be able to link pictures in the database - apparently it's not easy to do in SQL?[code]...
View 5 Replies
Feb 8, 2012
i can retrieve the data from the DB and put it in a vector and then, vector in a JTable, to display data in a tabular format in java, all i wanted to know is there any similar way in vb dotnet?
View 4 Replies
Apr 27, 2009
What suggestions do people have for a timeslot data structure? I have a number of activities and I'm planning to display them in a datagrid with days as columns and timeslots as rows. This suggests to me a timeslot data structure with 5 properties for the five days (the columns) for every value I want to use e.g. a timeslot ID and the number of slots left.
So.
Property Day1ID
Property Day1Slots
Property Day2ID
Property Day2Slots
Property Day3ID
Property Day4Slots
etc
Then each TimeSlot structure would be for a specific time. say 9:00 and another for each hour after that. Then I'd have a list of timeslot structures that will auto bind against the datagrid. I'm exploring new ground here and as you can see I'm not very clear on what/how to do it?
View 2 Replies
Jun 11, 2012
As discribed on this MSDN pageWhat would be the PHP equivalent? Is it even possible to do the three things listed on that page under remarks Streams involve three fundamental operations:You can read from streams. Reading is the transfer of data from astream into a data structure, such as an array of bytes.You can write to streams. Writing is the transfer of data from a datastructure into a stream.Streams can support seeking. Seeking is the querying and modifying ofthe current position within a stream. Seek capability depends on thekind of backing store a stream has. For example, network streams haveno unified concept of a current position, and therefore typically donot support seeking.
View 2 Replies
Apr 15, 2012
"Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables--a part number (type String), a part description (type String), a quantity of the item being purchased (type Integer) and a price per item (Type Integer). Your class should have a constructor that initialize for each of the four instance variables. Provide a property for each instance variable. If the quantity is not positive it should be set to zero. If the price per item is not positive it should be set to zero."
I attached the code I have. obj is underlined and says "Argument not specified for parameter 'Invoice4' of the 'Public Sub New (Invoice1 As Object, Invoice2 As Object, Invoice3 As Object, Invoice4 As Object)' and so the program won't run. What am I doing wrong?
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim obj1 As New Invoice(Val(TextBox1.Text))
TextBox1.Text &= obj1.Invoice1 & vbNewLine
TextBox1.Text &= obj1.Invoice2 & vbNewLine
TextBox1.Text &= obj1.Invoice3 & vbNewLine
TextBox1.Text &= obj1.Invoice4 & vbNewLine
[CODE]...
View 14 Replies
Feb 7, 2011
why this code doesn't work:[code]....
View 11 Replies
Mar 1, 2012
I have a problem with the filereader class (i think). My program has server/client interaction and the client reads from a text file, sends the data to the server. The problem is, the client is sending the last line of the text file twice, so for example I use test data in the text file such as:
Test data 1
Test data 2
Test data 3
The server will receive:
Test data 1
Test data 2
Test data 3
Test data 3
Here is my code, I have a feeling it is to do with the filereader.endofstream loop.
Private Sub readLine()
Dim filePath As String = ("D:outputLog.txt")
Dim fileReader As New StreamReader(filePath)
Do
chrMessageToSend = fileReader.ReadLine()
[Code] .....
View 9 Replies
Jun 24, 2011
i am creating a program which scans and saves images. in my program i have the option to save images and with each image i save it gets its own number for example: file1, file2, file3, file4 and so on. the only problem i have is getting the prgram to remember where it left off so it carry's on the number. my understanding is that i need to create some sort of stream writer or file stream class for this proccess to work. so it save's the last image number i was on, and carrys it on next time i open the program up again. and i also need it to re-write the new image number its on for next time. so i need to write and read the text file (.txt) and write it again if you catch my drift? i have a book to help but the wording in it is so confusing at the min, i m lost where to start.
View 1 Replies
May 21, 2012
I am working on an Examination system for a secondary school. The system captures the marks of students of the subjects they take and stores them in the database. from there, it has to compute the grades of marks for each subject that a student takes and get the position of that student in the stream and in the class.
For the gradeing part of it, I have already made it, my problem is to get the positions of students and show them on the rdlc report.
The word class and stream here, I mean;
The school has six classes, senior one/form one TO senior 6/form 6 as classes and each class(form) for example senior one has 4 streams. By streams, I mean; Students are grouped into different streams but under one class(level/form).
for example; form1 A TO Form 1 D that is one class/form secondary level. form 2 also has four streams ( form 2A, 2B, 2C, 2D) and so on. So a student can be number one in his stream but if the marks are compared to other streams of thesame level, he is number 3. it is indicated on the report as Position in Stream 1...........Class 3
View 8 Replies
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
May 5, 2011
Im making a desktop player for a online web radio, and for the program I wanna make it show all the stream info. Like the stream name, and such. However I dont know how to do this? I looked everywhere
The server url is setup like this "[URL]" And it has all the stream info and that there. So is there a way I can get the info from there onto like say a label? Live updates btw.
View 1 Replies
May 24, 2012
I am using a Data Grid View to display data that come in from a tcp stream. When the stream receives data, the data is parsed and placed at the top of the grid. These are my top 3 lines of the cell clicked event of the Data Grid View.
Code:
If SpotsGrid.CurrentRow.Index = Nothing Then Exit Sub
i = SpotsGrid.CurrentRow.Index
tempFreq = CStr(SpotsGrid.Item(1, i).Value)
I placed the top line there to prevent errors when a user clicks on a blank grid before any data has been placed in the grid and to stop selecting anything if a user clicks on a column header. But my problem is as data is added to the to the top line that line of data is not click-able because the index=0 or Nothing. So my question is what would be the best way to code this so it is protected from the user clicking on a blank grid and the column headers but still allow the user to click on the first line of data?
View 1 Replies
Aug 23, 2011
What are the best way to encrypt and decrypt stream of data ?I would like that my program read a file.. and unencrypt it in memory then when it save it.. it encrpyt the stream and save it.
View 1 Replies
May 17, 2009
I am sending data over a tcp connection but I need send it in pairs for it to be sent i.e. 1st Send (doesnt work), 2nd Send (works), third Send (doesnt work), fourth Send (works)
View 1 Replies
May 22, 2009
I am working on a program that alters very large images. The images are usually in .tif or .bmp format. I load up the old image, copy a section of it into a new image, then save the new image. So far everything works my problem is that the images that i have to alter are 900mb+. Using the simple Bitmap class is not working because the images are quite apparently too large to fit into memory that way. (throwing an OutOfMemory exception)I want to step over the part of loading the image, and turn it into streaming the pixels from the image straight from the disk. I kind of have an idea of how to get the stream open and start reading, but I have no idea what to do with the 32bit integers that are being returned. how to stream pixel data from an image?
Dim oldImage As Bitmap
Try
oldImage = New Bitmap(file)
Catch ex As Exception
[code].....
View 3 Replies
Dec 30, 2008
I've set up a stream reader to get data from a serial file, functionality for that is already set up.
My problem is that the program seems to be missing out every other line of code in the file, which kinda defeats the point of a serial file. [code]...
View 2 Replies
Jul 14, 2010
This app is trying to send messages to a client listening on the port. The client's logs show that their port is being opened and closed, but no data coming in. Is there a bug or something missing in the following code, like perhaps stream.flush or stream.endwrite or a thread.sleep(0) line, that could cause this? The puzzling thing is, WireShark on the client computer does show the message my app is sending coming into the listening port.
[Code]...
View 3 Replies
Apr 28, 2012
Connection succesfuly made (TCPClients) Writing/Reading with NetworkStream At an interval of 16 ms. Client sends 4 bytes -> Server receives 0 bytes ??? Server Sends 4 bytes -> client receives 0 bytes ???
[Code]...
View 11 Replies
Jul 2, 2011
Everyone seems to have their own TCP dilemma so I figured I'd ask this here and see what the pros have to say. Basically I need to connect to an IP 192.168.5.100, port 8000 and listen for all the data that is being sent out. When I Telnet to 192.168.5.100 8000, it shows as...
[Code]...
View 1 Replies
Jun 1, 2009
I have looked over this and can't see where i'm going wrong, all i'm trying to do is add an item to a listbox when i a tcpclient logs on to the server. Code in question... If i put a breakpoint in i can see that initialclientresponse is set correctly.
Public Sub ConnectClient()
Dim pendingClient As TcpClient
Dim InitialClientResponse As String
[code].....
View 8 Replies
Apr 1, 2009
I am looking to create a VB 2008 Express program which converts a data stream from a picoscope muscle sensor into a power output board which controls a mechanism. In simple terms when the Muscle sensor reaches a value of 0.8 V or higher I want the programme to send a text file to the power output control programme, and likewise when the sensor is below 0.2 V I want the power to be zero.
So 0.8 V > = send text file (0O=100%)
0.2 V < = send text file (0O=0%)
so when muscles being senced move the device turns on and off. I think I am successfully getting the data stream from the Picoscope which is plugged in the usb. I am using codes and examples that the programming guide for the device provided. [Code] I just need to now how to get the data to be displayed or how to tell the programme to do something with the data. The device also came with an example of how it can record data to an excel sheet if anyone needs the code to gain a better understanding.
View 20 Replies
Feb 1, 2009
I am downloading page data using the stream reader using readline.I want to concatenate each line into one long string for parsing The below line of code is not working: datajoined =dataline.Insert(datajoined.Length - 1, dataline.Length - 1)My inevitable goal here is to track stream data with a progress bar. But first I must learn to dload page data in chunks.
[Code]...
View 2 Replies
Jan 27, 2009
I am trying to make my application read data from a file. Then save the data back. However I keep getting an error which says the file is still open so cannot be edited. I also read that there is an issue with the streamreader and streamwriter do not close the program straight away. I was wondering if anyone had a way around this or any alternative ideas. Heres my code so far!
[Code]...
View 5 Replies
Sep 4, 2010
The RX data from the serial port is as follows:
FE FE FA E0 00 23 45 FD
I need to truncate everything else and just have positions 5, 6 and 7 output in the hex in a TEXTBOX. See below:
452300
Instead it will put the the whole steam in the textbox and it will be in decimal format, not hex.
View 3 Replies
May 25, 2009
I am sending data to server via TCP IP Connection. I am using a continuous loop at the server end - that accepts new clients and while streams can be read, it reads data stream.
The data is sent from the client with 2 leading bytes of data that represent the size of the packet of data sent and type of data.
My question is: how do I retrieve the size of the data packet and then check that this amount of data has been retrieved?
[Code].....
View 1 Replies
May 25, 2009
I am sending data to server via TCP IP Connection. I am using a continuous loop at the server end - that accepts new clients and while streams can be read, it reads data stream.
The data is sent from the client with 2 leading bytes of data that represent the size of the packet of data sent and type of data.
My question is: how do I retrieve the size of the data packet and then check that this amount of data has been retrieved?[code]...
View 9 Replies
Jun 1, 2011
I'm trying to convert old VB.NET code into C# and I'm not sure about the current line and what it means really.
[Code]....
View 5 Replies
Nov 22, 2011
I have a problem with the cryptostream, if i write the stream to a memorystream the memory that the stream used is still alocated and i have no way of unalocating it.what am i missingdoing wrong? im using-using on the streams,readers and crypto stuffs so the framework should shut them all down right? i tryed calling .close and .dispose but nothing ,in fact i moved it all over I have provided the sub that im using for the encrytion im in .net 4.5 so there is a lil async stuff but i know thats not the problem coz i moved this code out of my main app(.net 4) for testing to see if i could fix the problem.[code...]
View 12 Replies