|
using System.Windows.Forms;
namespace MyNamespace
{
public class Box : Control
{
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
hi, is there any way to divide my incomming internet bandwidth between processes, i.e. give my download manager 70% and my browser 30% of my bw!???
any one know any sources?!
|
|
|
|
|
Are you and malik0092 related? If not then this shows you haven't read the forum before posting
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Iam not malik0092 and the answer is different!
i want to identify my processes for example iexplore.exe and opera.exe and divide internet bandwidth between them!
|
|
|
|
|
I want to build two clients and a server, In which clients connect to server and send different files to write.these files include audio,video and text files. The problem is that the server has to identify the file format and if it is an audio or video file then it must give priority to it to write and if the server was writing any text file sent by any client during this if another client sent any audio file it must queue this text file and let the audio file to be written first and after completing it dequeue the text file and write the remaining.
please help me.
|
|
|
|
|
so what parts have you written so far? where are you stuck?
if you want someone to do it for you go to rentacoder.com else please ask a specific question!
|
|
|
|
|
Surely you only want to build one client?
Out of interest, why is it you want to do this? I ask because if it is for somebody, which it sounds like it is, then I think you are screwed. If you want to be a good developer you need to be able to take the time to learn... What was the last successful application you have developed?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Can you clariy that you want two different cleint programs or two client instances running? I'm guessing the later.
Next why do you only want to process a single file at a time? Why not place each upload on a seperate thread then they can be processed concurrently.
If you mean that you want to throttle your bandwidth usage so that different file types get uploaded at different rates then that is an issue with how you upload the files. AFAIK, you can't just stop reading from a comms stream and it stops the client from sending. Someone else (Luc) can correct me.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
well i am a newcomer in this language.i am student of bscs. i have developed a tic tac toe game recently as a project from univrsty. Now i have another one which i discused. i have developed the whole program. it doesn,t give any error but it stucks while uploding a file from a client. both clients and the server r on the same machine. i have placed cheks for extensions. and also implimented queues.but unable to get the requred result.whereas without cheks it works properly(but one client can send one file at a time.)
|
|
|
|
|
You rang, my Lord?
I have no experience prioritizing/throttling HTTP or TCP/IP traffic (I only did it on proprietary protocols which provided explicit support for it), however I concur the first step is to implement proper threading at the server side so each request gets one thread, and probably on the client side as well.
Since (network)streams are used, one can control the throughput explicitly, however IMO a general-purpose server would find that hard to do: it would have to figure out different requests are coming from the same client so one of them needs to be slowed down (shouldn't slow down a low-priority job for a client that has no high-priority job); and it should do so in a scalable manner.
OTOH if a client only needs a limited throughput for some transfer, it can easily organize that by inserting appropriate delays with Thread.Sleep or some timer.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks, that's what I thought.
I've throttled the processing at either end but never tried to control the actual traffic.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi,
I have a file which has EBCDIC data. I need to convert this into ASCII. But since this EBCDIC data also has 'packed decimal' i'm not able to convert this.
Kindly let me know how to unpack this packed decimal, then later i can convert them to human readable ASCII format.
Thanks!
Deepa
|
|
|
|
|
Hi, Have you found a solution for this. I am running in to the same issue
|
|
|
|
|
See my answer off initial post.
|
|
|
|
|
1. Make sure you are getting the file transferred as binary (BIN) not text from the AS/400 (MF). Default would be text which will alter your values before you can read them.
2. Here ya go (C#):
```
using System.Linq;
namespace SomeNamespace
{
public static class SomeExtensionClass
{
public static decimal FromPackedDecimal(this byte[] value, byte precision = 2)
{
if (value.Length < 1)
{
throw new System.InvalidOperationException("Cannot unpack empty bytes.");
}
double power = System.Math.Pow(10, precision);
if (power > long.MaxValue)
{
throw new System.InvalidOperationException(
$"Precision too large for valid calculation: {precision}");
}
string hex = System.BitConverter.ToString(value).Replace("-", "");
var bytes = Enumerable.Range(0, hex.Length)
.Select(x => System.Convert.ToByte($"0{hex.Substring(x, 1)}", 16))
.ToList();
long place = 1;
decimal ret = 0;
for (int i = bytes.Count - 2; i > -1; i--)
{
ret += (bytes[i] * place);
place *= 10;
}
ret /= (long)power;
return (bytes.Last() & (1 << 7)) != 0 ? ret * -1 : ret;
}
public static decimal FromPackedDecimal(this string value, byte precision = 2)
{
return System.Text.Encoding.GetEncoding("IBM037")
.GetBytes(value).FromPackedDecimal(precision);
}
}
}
```
Details on specification: Packed Decimal Format
Cheers!
Willow
modified 10-Jun-20 13:20pm.
|
|
|
|
|
I want to modify a table's structure with a method.
Please help how to write this method!
I've tried:
public void tableExpand(string tableName, string colName)
{
...................
dataCommand.CommandText =
"ALTER TABLE @tableName" +
"ADD @colName real";
SqlParameter tableParam = new SqlParameter();
tableParam .ParameterName = "@tableName";
tableParam .Value = tableName;
SqlParameter colParam = new SqlParameter();
colParam .ParameterName = "@colName";
colParam .Value = colName;
dataCommand.Parameters.Add(tableParam);
dataCommand.Parameters.Add(colParam);
.....................
}
But this isn't the right way
|
|
|
|
|
Is it possible to parametize a stored procedure? I need a table to store some vectors. I must calculate the dimension of the vector space, and then to build the table with this parameters.
Ex: V(0.2 4.5 2.1 0.0 5.1 1.0........). This is a document vector, and its dimension would be, the no. of distinct words in a document collection.
|
|
|
|
|
Hi,
I have a Project combobox which I populate from the values from database table.
I want ask user to add new project if he does find the revevant project in the list and so as update the database table.
Is it possible in windows c# ?
Thanka in advance
|
|
|
|
|
priyanka_jns wrote:
Is it possible in windows c# ?
yes
|
|
|
|
|
can u please tell me . How ?
|
|
|
|
|
Hi All,
I m accessing the notes mail using notesDocument, I am able to get all teh properties of mail but if I want to access the mail like it is manually done, (color changes). how would I access the mail in that way..
My main problem is , I have infected file attach to lotusnotes mail and it is not detecting while I am accessing mail properties programmatically but if manually clicking it does..
I am using Domino dll for this automation.
Thanks
|
|
|
|
|
how do you check if a particular activeX is installed on the PC? I do not wish to catch InteropServices.COMException or any other exception just to determine if the activeX is installed.
|
|
|
|
|
You could look if HKEY_CLASSES_ROOT has a key corresponding to the ActiveX name, or if HKEY_CLASSES_ROOT\CLSID has a key corresponding to the ActiveX guid.
EDIT: used CLID instead of CLSID, now corrected.
modified on Tuesday, May 19, 2009 8:52 AM
|
|
|
|
|
how to convert any parameter type into object?
thanks
|
|
|
|
|
In .NET everything is derived from an object - so you can just cast it.
object o = (object) param;
Or is that not what you wanted?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|