User Profile
Collapse
-
I understand now. Great answer! Thanks for taking the time to explain. -
I still don't get it, sorry...
The Array.Sort() method changes the provided array object, does it not? But the parameter is passed by value, not by reference. Then, how come a parameter that is passed by value be altered after the method call returns?Leave a comment:
-
Array.Sort(Array arr)
It just came to my mind... The method sorts the provided array, but it doesn't require ref or out parameter (C#). How does it alter the elements of the array then? Does it use explicit pointers internally? Just wondering... Thanks. -
You're kidding, right? VS Express is free, but nowhere near open source....Leave a comment:
-
I suggest you use SharpZipLib instead. GZipStream is very limited.Leave a comment:
-
And how come it works in VB.NET? Because I didn't instantiate an object of type Form2 anywhere......Leave a comment:
-
Form.Show C# vs VB.NET (2005)
Hi.
Try this:
Create a new VB.NET windows application and put on button on the form. Now add a new form to the project (Form2) and in the Click event handler of the button from the first form put this code:
Form2.Show()
It will work, and when you click it, the second form will be shown, but only one instance, no matter how many times you click the button.
Now do the exact same steps,... -
Web Service to send files
Hi. I'm a .NET programmer with little Java experience. I want to create a web service to send update files to a program. The requirement is that it will be hosted on Linux, so I have to do it in Java.
What tools should I use? (IDE, Web Service library, Web aplication Server, etc)
I find it very confusing so far. There are all this 3-rd party libraries (like Axis, Axis2), which are not backwards compatible and there seems... -
You can also do it by hand and avoid any possible Format mismatches:
Use the string Split() method to get the 3 components and then create a new DateTime object using the constructor that asks for 3 integers (date, month, year).
To convert a string to int use Convert.ToInt32 () method.
GL.Leave a comment:
-
I'm not 100%, but I think that
ReceiveStream.P osition = 0;
will do the trick. Put it just before the last line....Leave a comment:
-
Do not use ArrayList!!
In .NET 2.0 ArrayList has been replaced by List<>. It is much much faster because you can specify which type the object in the list are, so boxing-unboxing operations are not necessary.
example:
List<string> myStringList = new List<string>();
myStringList.Ad d("aaa");
myStringList.Ad d("bbb");
you can also easily remove...Leave a comment:
-
StreamReader and "using" statement
Hi.
In my application I write errors which may occur to text file like this:
using(StreamRea der sw = new SteamReader(err ors.txt, true))
{
sw.WriteLine("E rror message here");
}
Sometimes, the program says that it cannot open "errors.txt " because it is being used by another process. The only process that might be using it is my application. So basically it's a file lock... -
The instantiation and initialization of the Random object must only be done once.
After that use the Next() method inside your loop.Leave a comment:
-
How to see which ports are used by .NET&WSE application?
Hi.
I wrote a .NET application which uses WSE2 & WSE3 to communicate with multiple web services. Now some of the people which are using it are saying that the application is blocked by their firewall software, so they manually must open the required ports.
Which is the easiest way to see all the ports that must be opened?
Thanks. -
This is how you read the file into a byte array:
FileStream fs = new FileStream(file One, FileMode.Open);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData , 0, (int)fs.Length) ;
For the opposite operation, use the "Write" method instead and also change the "FileMode" in the consttuctor to "FileMode.Creat e"....Leave a comment:
-
If file1.txt exists already:
StreamWriter sw = new StreamWriter("f ile1.txt", true);
sw.write("some text here");
or, even easier, but significantly slower:
File.AppendAllT ext("file1.txt" , "some text here");Leave a comment:
-
The SqlConnwction class has a property called "State". It's an enum type an it can take these values: Broken, Closed, Connecting, Executing, Fetching, Open.Leave a comment:
-
Read the section "Because acronyms are fun" from this blog:
http://blogs.acceleration.net/ryan/category/23.aspx/rss
He's had the same problem as you and apparently solved it....Leave a comment:
-
I think it is "//xsi:Url". Because of the // operator you don't have to specify the whole tree hierarchy....Leave a comment:
-
No activity results to display
Show More
Leave a comment: