|
Hi,
I'm new in here.
I want to send a wav file through a socket in C#. The socket works fine, text can be send through it. How can I send a file in "parts" over the network. For example a file of 100kb must be send in parts of 4kb (25 * 4kb). On the other side of the socket, it will be stored in a buffer and it will be played.
Or is there another method to send audio?
A detail: the software is running on WinCE. (some parts of the code may be different from C# for WinXP)
Thanks in advance.
|
|
|
|
|
The most important part of streaming data over the network is to remember to use:
System.Net.IPAddress.NetworkToHostOrder
and
System.Net.IPAddress.HostToNetworkOrder
If you are using a TcpIp socket don't send in parts, the nagle algorithm is very efficient. However, on the receiving end you can choose which chunks to use and when.
If order is not important, speed is paramount, and only 4kb at a time use Udp datagrams.
File Not Found
|
|
|
|
|
Tnx,
I've read about the nagle algorithm... and yes I'm using a TCPIP socket.
I'm trying to implement it.
If there is something not working I'll post it.
Thanks.
|
|
|
|
|
Greetings,
I'm currently working on a C# application which interacts with data in an Access DB containing 2 tables. One table has 56 columns which I store related ID's in corresponding to the second table. These ID's are of the Text type and I have set the size field to 255 which is the maximum allowed text field in Access. The trouble is when I go to call the DataAdapter Update command passing it a dataset, after the update successfully updates 16 of the columns the 17th fails and says "Record too large". I have verified that the data in this column is exactly the same size as the others, 251 bytes, and also that it does not matter which column is the 17th to be updated I always recieve this error; i.e. even if the 17th column to be updated is actually the 24th in the database the error still occurs. I am not using the CommandBuilder object because I have had problems with the default optimitic concurrency creating an SQL Update Command that is too large for Access, it has too many AND parameters.
At first I believed it to be a problem with the amount of data that I am updating with one single update call so I split the UpdateCommand into 4 different Commands, updated using the first update command, set the rows in the dataset to modified, changed the update command to the second one, etc...
This is how I determined that it is always the 17th column to be updated. If I have 16 columns in the first update command the first successfully completes and the error occurs in the second. However if I have 17 in the first the error occurs there. Any help appreciated and I will clarify and confusion or questions that you have.
Thank you for your time,
Blake M. Ward
-- modified at 13:31 Monday 5th March, 2007
|
|
|
|
|
It's not the update query that is the problem, but how much data you put in the database record.
Access has a limitation on the size of a data record. In Access 97 and Access 2000 it is 2048 bytes, but it seems that it has been increased to 4096 bytes.
If you want to put more data than that in a record, use the Memo data type. The actual data is stored outside of the record so you don't have to worry about the record size, and there is no size limit on the field. The entire database is limited to 2 GB, though, and each table is limited to 1 GB.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you for the response and information. It seems unfortunate that the database is limited at 2GB with a 1GB table limit but since that is what I have to work with it'll have to do. I will work on changing to the memo type.
Thanks again for your time,
Blake M. Ward
|
|
|
|
|
Hi,
I've Microsoft .Net Framework SDK v 2.0 . I've downloaded some demo projects from codeprojects. But when i want to setup project it says that i need .Net Framework 1.1.4322 Is there any way to setup those projects in the current version of .Net ?
001
|
|
|
|
|
Just recompile them, the framework is backwards compatible.
|
|
|
|
|
How can i compile a windows installer package?? (I've only demo project, no source code)
001
|
|
|
|
|
The source code is hidden by the designers, you can build it by right clicking the project and selecting build from the Solution Explorer.
|
|
|
|
|
How is it possible to build an array of a generic type collection?
For example this is what I am to populate the ForwardCurves generic collection.
Notice that this is ok for the first loop.
For the following loops I wouls like to add to this generic collection i.e. ForwardCurves but would like to identify each loop separately in the generic collection.
Something like:
ForwardCurves[i].Add(forward);
Is this possible?
Thanks
Thsi is what I am doing now but you can not identify each table loop in the generic collection.
List<forward> ForwardCurves = new List<forward>();
foreach (DataRow row in table.Rows)
{
Forward forward = new Forward();
forward.IndexID = row["IndexID"].ToString();
ForwardCurves.Add(forward);
}
|
|
|
|
|
arkiboys wrote: Is this possible?
Yes
led mike
|
|
|
|
|
|
List<int>[] arrayOfIntLists = new List<int>[10];
|
|
|
|
|
Assuming there is a dataset i.e. ds
And there are tables in the dataset i.e. 10 but it can vary...
Then I think I should have a foreach loop to go through the tables and populate the collection.
foreach (DataTable table in dsMarketValuesCombinedByIndex.Tables)
{
Not sure what to put inside the foreach loop.
Thanks
|
|
|
|
|
List<List<BaseProvider>> providerMatrix = new List<List<BaseProvider>>();
led mike
|
|
|
|
|
Is this different?
List<BaseProvider>[] providerMatrix = new List<BaseProvider>[];
|
|
|
|
|
|
Hello!
I'm trying to write a tool that associates some data with the currently logged on Windows user account. I.e. the encryption key for the file is generated based on the user.
How can I do this?
Of course, just using the user name is bad, because it should also depend on the users password. Unfortunately I haven't found a function to get the user's password (is there one?).
I tried using the System.Security.Cryptography.ProtectedData.Protect function. The problem with this approach is that this function returns a byte array that includes a seed. I.e. when calling this function twice, you'll never get the same results. But this is a requirement, as I want to use its output only as key for my own encryption engine (which offers choice between different algorithms, like AES, Twofish, ...).
Best regards
Dominik
|
|
|
|
|
Using the users name is a bad idea because a user can change their name.
You also cannot use a users password because, for one, passwords expire and change, and two, there is no function to get the password.
About the only thing that doesn't change in a user object is it's SID.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I know that the SID is the only constant thing in a users account, but it is public isn't it?
An administrator can easily read all SIDs of users in a network. Therefore, using just the SID is a bad idea, too...
Any other way?
Thanks for your reply and best regards
Dominik
|
|
|
|
|
I've just found a solution and wanted to quickly let you know it, in case it's interesting for you, too:
First, a random byte array is generated using a cryptographically secure random number generator. This is the key used for encryption. It is protected using ProtectedData.Protect with the DataProtectionScope.CurrentUser option and written to the registry.
When loading, the protected key is retrieved from the registry, unprotected using ProtectedData.Unprotect and used as decryption key for our file.
I'm not sure what data ProtectedData is using, but it seems that the password can be changed, without making the ProtectedData behavior change, i.e. the user's password actually doesn't matter. Same applies to the user name. Probably Windows keeps some secret key for each user, which we can't access manually.
Best regards
Dominik
|
|
|
|
|
hi
i write my app with vc#2005 and crystal report for vs2005, i want to create setup package for my app, but how to do ??
thanks..
|
|
|
|
|
|
Hi,
A stored procedure runs three select queries.
Each of these select queries is being assigned to a table (See below).
The question is: In this case I know how many tables are returned so I use the "oDA.TableMappings.Add" three times. But what if I do not know how many tables are returned? How can I make a dynamic loop arouond "oDA.TableMappings.Add"?
Alternatively, Is it better to retrieve the whole of data into one dataset and then separate the data into datatables?
This is what I am doing at present:
SqlDataAdapter oDA = new SqlDataAdapter(oCmd);
//use Tablemappings to name the retrieved tables...
//otherwise have to use indexes to refer to each table...
oDA.TableMappings.Add("Table", "Curves1");
oDA.TableMappings.Add("Table1", "Curves2");
oDA.TableMappings.Add("Table2", "Curves3");
DataSet dsData = new DataSet();
oDA.Fill(dsData);
This is what I am trying to do:
SqlDataAdapter oDA = new SqlDataAdapter(oCmd);
int i = 0;
foreach(table in oDA)
{
oDA.TableMappings.Add("Table" + i, "Curves" + i);
}
DataSet dsData = new DataSet();
oDA.Fill(dsData);
|
|
|
|