|
Ok.. And that yourself have told that "Use generics for what they're for."
And i am expeing the answer "what they're for". explain your thoughts if you dont mind. rather than a negative answer.
Let others also post their thoughts. we can have a collective set of good things which will defenetive contain some good points that even you were unaware or not thought about till this point of time.
|
|
|
|
|
If you picked up a book, or did some online research, you would know exactly what generics do, when to use them, and what they're "for".
This forum is to provide specific answers to coding problems in C#, not to do your research for you.
|
|
|
|
|
Please do understand that i dont want to do any research and right now im not of any use on generics.
|
|
|
|
|
Skpananghat wrote: i dont want to do any research
And you expect us to share our opinions? What's the value of an opinion if it isn't based on experience or research?
QPQ, I'll give my opinion on generics once you can tell me in three lines (or less) what a "generic" is and how I might recognize one when I trip over it
I are troll
|
|
|
|
|
I certainly love generics.
I use them all the time, I don't get why so many people still use arrays in C# when only few or rarely used .NET methods need them.
Enough opinion?
|
|
|
|
|
Megidolaon wrote: Enough opinion?
Yeah, but my point was that an opinion isn't a research-tool for the lazy. I like red, but that opinion doesn't make red a "good" color for the walls or the ceiling. Asking generally for peoples' opinion because one is too damn lazy is like asking what color your ceiling should be. It should be red. Because I like red. The TS should avoid generics because his "research" (which consists of the collection of answers to his question, therefore our posted opinions) state that "red" is better than "generic".
Without the usual sarcasm;
I enjoy using generics as it increases my productivity, compared to handwriting strong-typed collections. It saves the time that is required to launch and execute CodeSmith, and I enjoy having a built-in collection over an external generated collection as reduces complexity and improves readability and maintainability.
I are troll
|
|
|
|
|
As good as they are, they don't go far enough.
|
|
|
|
|
i am developing a aplication in c#, and i need your reviews for my application, i am a chilean programer and i need a evaluation for my job, i am student of enginering of the informatic in first year.
here my aplication its name FastInfo.
http://rapidshare.com/files/202732805/FastInfo_Installer.exe.html[^]
thanks to all.
PD: sorry by my bad english.
modified on Thursday, February 26, 2009 5:39 AM
|
|
|
|
|
what this exe is??
and review you want for this??
|
|
|
|
|
1) Upload sourcecode, not binary. Executables are scary and may contain monsters and virusses.
2) A nice introduction to "FastInfo" would have been appreciated, so that one knows what you're getting into before you download.
So, where's the source, Luke?
I are troll
|
|
|
|
|
There is a bug in my application that on resizing Form it changes top,left position of user control on it. I have gone through all code and nowhere in my application i have written code to do this.
Is there any 'property' that does this?
Any help would be good.
Thanks,
AksharRoop
|
|
|
|
|
Check the Anchor property of that user control.. It should be set to top left alone to get it corrected as you wish
|
|
|
|
|
It worked.
Thanks a lot,
AksharRoop
|
|
|
|
|
Check the control's anchor property. You probably set it incorrectly.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
While downloading files from FTP-server through HTTP-proxy I've met the following problem: sometimes there are some zero bytes in the begin of the response (62 or 63 bytes),the end of the stream was truncated by the same count of bytes.
But the bug is not constant. If I try to download file without proxy, everything is fine.
What can be the reason of this problem and how to solve it?
Here is some code that I use to download files.
Uri srcURI = new Uri(SourceURL);
if (srcURI.Scheme != Uri.UriSchemeFtp)
throw new Exception("URL has invalid format");
FtpWebRequest webReq = (FtpWebRequest)(WebRequest.Create(srcURI));
webReq.Method = WebRequestMethods.Ftp.DownloadFile;
webReq.Timeout = 5000;
webReq.ReadWriteTimeout = 10000;
webReq.UseBinary = true;
webReq.UsePassive = true;
webReq.KeepAlive = false;
webReq.Proxy = proxy;
webReq.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
try
{
FtpWebResponse webResp=(FtpWebResponse)(WebReq.GetResponse());
if (webResp.ContentLength == -1)
throw new Exception(string.Format("Can't download file: {0}",
WebReq.RequestUri.Segments[WebReq.RequestUri.Segments.Length - 1]));
string fname = WebReq.RequestUri.Segments[WebReq.RequestUri.Segments.Length - 1];
OnUpdateDownloadStatus(string.Format("Downloading file {0}", fname), -2);
string path = string.Format(@"{0}\{1}", DestFolder,
fname);
Stream fs = File.Open(path, FileMode.Create);
int cnt = 0;
using (BinaryWriter bw = new BinaryWriter(fs))
{
byte[] buf = new byte[ChunkSize];
using (Stream s = webResp.GetResponseStream())
{
do
{
if (AbortDownload)
throw new Exception("Downloading was canceled");
cnt = s.Read(buf, 0, ChunkSize);
bw.Write(buf, 0, cnt);
int percent = (int)(bw.BaseStream.Length * 100 / webResp.ContentLength);
OnUpdateDownloadStatus(
string.Format("Downloading file {0} : {1} %", fname, percent), percent);
}
while (cnt > 0);
}
}
}
catch (Exception exc)
{
StatusMessage=exc.Message;
}
finally
{
if (webResp != null)
webResp.Close();
OnDownloadComplit(StatusMessage);
}
}
modified on Thursday, February 26, 2009 6:33 AM
|
|
|
|
|
I found the decision here!!! So, Thank's for codeproject!
|
|
|
|
|
Dear All,
I have a DLL with method signature like this :
void printname (char* name)
I tried using the following code to to make use of my method:
-----------------------
string s="abc.xml";
char[] b = new char[100];
s.CopyTo(0,b,0,20);
unsafe {
fixed (char* p=b);
printname(p);
}
------------------------
but it seems not working....
can anyone give me some hints ??
Thanks,
Leslie
|
|
|
|
|
(char* name) Means it is a single char right ? or else it should be
(char** name) if it is an array. May be it needs the first Position.
try s[0] where s is a string in your case
|
|
|
|
|
MSDN[^]
another reference : MSDN[^] Last modified: 18mins after originally posted --
|
|
|
|
|
You don't need the char array.
char* tends to be strings, you may be able to pass a .net string in directly.
Otherwise, maybe fixed (char* p=s)
Plus you shouldn't have the semi-colon after the fixed statement.
|
|
|
|
|
Dear All,
You have be soo helpful !! I let you know which one is working as soon as get back from home !!!
Regards,
Leslie
|
|
|
|
|
hi,
how i can know the username of each process on pc like username in the task manager in c#?
|
|
|
|
|
You can use System.Diagnostics.Process.GetCurrentProcess to get the list of process which are running, assign it to the "Process" class one by one and then you can find a whole lot of info about each process
|
|
|
|
|
Hi There
I am using encryption and decryption using RijandaelManaged algorithm.
When I write integer in plain form .It is occupying 4 bytes.
When I use encryption It is occupying 16 bytes.
Can anybody tell me why?
Your response will be apperciated
Thanks
|
|
|
|
|
Encryption makes it "bigger". If it didn't, it would be relative easy to crack.
A text that gets encrypted usually isn't the same size as the encrypted version.
I are troll
|
|
|
|