|
string[] numberstrings = mystring.split('>');
int[] numbers = new int[numberstrings.Length];
for (int i=0; i<numberstrings.Length; i++)
{
numbers[i] = int.Parse(numberstrings[i]);
}
You might want to make sure that all the strings that come out of the split really are numbers through so you should probably wrap the line in the for loop with a try/catch statement to be safe.
-- modified at 10:52 Monday 5th June, 2006
|
|
|
|
|
Hello!
I am trying to use GZipStream to compress an XML file before writing it to disk. But unfortunately it doesn't work 100% correctly... The file written to disk is a valid GZ file up to the very last few bytes. The whole file can be decompressed without any problems, except that the very last few bytes are broken and get decompressed incorrectly...
My code basically looks like this:
FileStream fs = new FileStream(strFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
Stream writerStream = new GZipStream(fs, CompressionMode.Compress);
XmlTextWriter xtw = new XmlTextWriter(writerStream, Encoding.UTF8);
WriteDocument(xtw);
xtw.Flush();
writerStream.Flush();
fs.Flush(); fs.Close();
Files mostly get decompressed incorrectly like this (_ are spaces):
________</Group>
____</Group>
</Root>
</SplConfFile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5il
Do you have any idea what could be the problem? Why are the very last few bytes corrupted?
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I've found the problem now. There is a bug in the GZipStream class of .NET 2.0 (yes, in the class, not in my code). You need to close the GZipStream manually...
For more details see this bug report at MSDN Product Feedback Center:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=efaebf8f-8b1c-45e1-b355-6c6953aa221a[^]
I wonder why they released .NET 2.0 with such a long-known, serious bug...
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
hi
when we press alt+shift inside textboxes, we convert to the second
keyboard language . what i want is to do this programmatically
i.e directly start writing in the second language
Tamimi - Code
|
|
|
|
|
You might be able to accomplish this by calling the SendKeys.Send method, passing a string which represents Alt + Shift. The docs for that method explain the symbols used to represent those non-alphanumeric keys.
Josh
|
|
|
|
|
HI!
I want to integrate some of VOIP applications in my .NET application.I have infos like email, mobile, telephone and I want to start a 3rd party VOIP application with number as parameter. Have anybody tried that? I use programs like VoipStunt, but don't know how to start and proceed with given number.
Thanx!
Ante
|
|
|
|
|
RahulRKulkarni wrote: Where would i get information of assembly, webconfig, machineconfig files of .Net
You'll find all that information on MSDN[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi all,
how to disable sorting when one clicks on a columnheader ?
(i programmatically sort according to my wishes. and dont want it to be changed in runtime)
|
|
|
|
|
Are u using BoundFields or Auto-Genereted Fields???
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:12am.
|
|
|
|
|
In property of GridView1 u have AllowSorting property set it to false.
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:12am.
|
|
|
|
|
Sure it is.
Check this article too
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.allowsorting.aspx
|
|
|
|
|
Any idea how to do this with the System.Windows.Forms version of the DataGridView?
Iain
|
|
|
|
|
hello.
how are you all.
"How to Access signature of a file or how we can get information from Header of a file", through which we can compare it with other file to find its diginity.
muhammad mahmood ilyas
-- modified at 7:44 Monday 5th June, 2006
|
|
|
|
|
Mahmood Ilyas wrote: is any one know about "How to Access signature of a file or how we can get information from Header of a file", through which we can compare it with other file to find its diginity.
Can you explain this better please, do you want to identify the file type from byte patterns or simple compare files? What do you mean by diginity?
Mahmood Ilyas wrote: please send me solution of it.
To be blunt, that is your job, we help with specific problems relating to C#, you create the solution (with probable problems, which we help to fix).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hello.
how are you all.
i am working on my final degree project in these days and my project is antispyware.
in antispyware, i am to use signature base scanning technique. for it i need algorithm for implimentation. i am still unable to find such algorithm or sample source code which can help me in my project.
will anyone can help me to solve this problem. if some one know about it, please send as soon as possible.
thank you
muhammad mahmood ilyas
|
|
|
|
|
If it's your final project should you...I don't know...actually do it yourself?
|
|
|
|
|
|
Hi Mahmood
Maybe you should have a look at the ClamAV - Project at Sourceforge.net
(http://sourceforge.net/projects/clamav).
It is written in C and is based on a pattern-technology.
You might know, but an antispyware application means a lot of work for you.
Good luck with your project
Eric
|
|
|
|
|
Hi,
I have a header file with some constants, e.g:
#define PRODUCT32_BUILD 4
#define INTERNAL_VERSION 1
#define INTERNAL_RELEASE 2
#define INTERNAL_SUBRELEASE 3
#define INTERNAL_BUILD PRODUCT32_BUILD
...
Then I have a C# project with class 'AssemblyInfo.cs', with informations like this:
// Appears as 'Assembly Version' and 'File Version' in file properties dialog box
[assembly: AssemblyVersion("0.0.0.0")]
...
What I need is to find a way, how to use the constants of the header-file to change the information in the 'AssemblyInfo.cs' of the c# project. So the result after the build will be : [assembly: AssemblyVersion("1.2.3.4")]. The 'AssemblyInfo.cs' must be changed before the build runs. Start with something like a pre-build and then build?
Regards Daniel
Daniel Dusek
-- modified at 7:13 Monday 5th June, 2006
|
|
|
|
|
Is the header file a C# file because that code will not compile, C# seems to only allow you to define symbols and not the C style macro replacements.
I'm guessing that that header file is for another part of the project written in C++ or another language and you want to use that header file to define the assembly version of the C# project, am I correct?
I just tried something like this: [assembly: AssemblyVersion(System.IO.File.ReadAllText(@"temp.txt"))] to see if you could write a static class that would parse the header file but it returns this compile error: An attribute argument must be a constant expression, typeof expression or array creation expression.
So it looks as if you can't do it directly in C#.
The only possibility that I can think of is if you create a small program which parses your header file to extract the version information and then inserts this into the AssemblyInfo.cs file and run this program as a pre-build event.
Hope that's of some help.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi Ed,
ok, it seems, that there is not an easy way to use this header file in c# project. You are right, the header is from c++ and it is used for all other c/c++ projects. My colleague gave me already an advice how to solve this : I have to make an managed c++ project, which will have just one class and will include this header file. And this c++ project will be used in the c# project...
So far thank you. Ragards Daniel
|
|
|
|
|
That won't change the version number, unless you write the C# project in the C++ project, which would mean that it's not a C# project . I.e. the C++ project would have it's own assembly versiona and the C# would have a different version. (Since VS.NET does not support projects containing, for example C# and VB code or C# and C++ code, you have to seperate them into different projects).
I'm pretty sure of that anyway.
If the other suggested method works then use it but I still think that writing a simple parser would be more flexible, reliable and a better use on resources. (It could even be done in a Batch file but since you've got .NET on the development machine then it'd be simpler to write a .NET executable).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Ed.Poore wrote: (Since VS.NET does not support projects containing, for example C# and VB code or C# and C++ code, you have to seperate them into different projects).
Apparently (in VS 2005) you can have C# and C++ in the same project - provided that the base project is C++. No idea how you do this though!
Kevin
|
|
|
|