|
Check out ServiceController class in the ServiceProcess namespace..
Bijesh
|
|
|
|
|
Thanks for reply
I have tried with that but ultimately getting success from WMI.
evil
|
|
|
|
|
hi guys could anyone recall how to remove duplicated values in an array like:
string asd = new string[10];
lets say the values are 1,1,1,2,3,4,5,2,1,3,2
i want to remove the duplicate to make it:
1,2,3,4,5
anyone know? any functions to remove the duplicated or do i have to create a for loop to remove them 1 by 1?
|
|
|
|
|
Hello,
neodeaths wrote: do i have to create a for loop to remove them 1 by 1?
Actually I would add the ones who are unique, to an other collection!
neodeaths wrote: string asd = new string[10];
lets say the values are 1,1,1,2,3,4,5,2,1,3,2
One value to much I think! (Just a joke! For those who think I'm peeping somebodys question!)
But I than would create a StringCollection to add the values.
If you need it as an sring[] there is a CopyTo method which will do that!
string[] sArray = new string[10];
sArray[0] = "1";
sArray[1] = "1";
sArray[2] = "1";
sArray[3] = "2";
sArray[4] = "3";
sArray[5] = "4";
sArray[6] = "5";
sArray[7] = "2";
sArray[8] = "1";
sArray[9] = "3";
System.Collections.Specialized.StringCollection filteredCollection = new System.Collections.Specialized.StringCollection();
foreach(string s in sArray)
{
if(!filteredCollection.Contains(s))
{
filteredCollection.Add(s);
}
}
string[] sArraynew = new string[filteredCollection.Count];
filteredCollection.CopyTo(sArraynew,0);
Hope it helps!
All the best,
Martin
|
|
|
|
|
Here's one way:
public static string[]
clean
(
string[] Dirty
)
{
string[] result ;
System.Collections.Generic.Dictionary<string,object> temp =
new System.Collections.Generic.Dictionary<string,object> ( Dirty.Length ) ;
foreach ( string s in Dirty )
{
if ( !temp.ContainsKey ( s ) )
{
temp.Add ( s , null ) ;
}
}
result = new string [ temp.Count ] ;
temp.Keys.CopyTo ( result , 0 ) ;
return ( result ) ;
}
|
|
|
|
|
Hi,
I have coded my complete data in c#. I have to now convert this to either xml or html. can anyone help me out?
Thanks in advance..
SRUJANA
|
|
|
|
|
Which do you want to convert, data ( trivial ) or a form ( impossible ) ? To convert data, just create an XmlDataWriter, and create a schema, and iterate over it. The other question is, why do you need to convert it ? html and xml do very different things, html is not even guarenteed to be XML, XHTML is, tho.
BTW, I don't get email responses right now, so I may not reply if you post down here, you may want to repost the question with more details.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Thank u.....
I have tried to search ur id..got ur link but couldn't post reply there.
My project actually exports the form to different formats like xml,html,rtf so on... conversion among them has been completed successfully...primary conversion i.e. form to any of these would make my job complete. so i require to convert form primarily to any of these and later to required format. so if possible help me out..
SRUJANA
|
|
|
|
|
i.m beginner in C#
Could someone tell me how to make a search funtion so the result can appears in a gridview?
Regard,
Tom
|
|
|
|
|
Better Buy a C# Books and start reading the concepts and try to implement it.
If we say it for the Searvh function you could not able to understand it without knowing the concepts.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Ok, I finally got a little OCR working like I need for now and I want to give it to a friend. But it wont run on hes computer.
When I When I just give him exe and dll files then it gives some error about hardware, but when I use "publish" to make installer I get some error that installer cannot DOWNLOAD the application data. I chose that I will publish it via CD/DVD rom, no auto-update etc. What I did wrong?
I use VC# express 2005.
Heres full installation log: http://jg.srhost.info/log.log
Thankyou
EDIT:Sorry about bad english, not my native language plus Im really tired (5am here)..
|
|
|
|
|
I don't see anywhere that you're giving him the .NET framework. Sounds like you're trying to setup a clickonce installer that expects to download from a web server. Installing .NET and then your app will work.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Actually the log is from I own comp. I get same error when running installer on my own comp.
And that "friend" also has .NET framework
|
|
|
|
|
OK, then the 'some error about hardware' that you're getting, tells you what the hardware problem is.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am tryin to release my application from visul studio but i dont know if i am doing it correct ,, if i try to run my application in other systems it doesnt work but it works ok in my system ,, can any one help me ?
|
|
|
|
|
Hi,
if the other system does not have (the right version of) .NET, you would
get a rather mysterious error dialog with an error number; if so show it.
otherwise, the problem should be recognizable from looking at the Exception.
If you havent done so, I strongly recommend to enclose everything in your
static Main() method with a try catch construct; in the catch(Exception exc)
show the entire exception as in MessageBox.Show(Exception.ToString());
|
|
|
|
|
there is no .Net in the other sytem ,,
the error messeage is about the .net framewrok:
The setup require the .Net framework 2.0.50727 pleae install the .net ..........etc
|
|
|
|
|
So, that problem is solved. Install .NET then install your app.
Lucky you, an app missing an earlier .NET version just gave an error code.
|
|
|
|
|
Thankx alot !!!
i thought taht there is something else
|
|
|
|
|
Can anyone give me some examples of CDMA, A Web Site to check out for CDMA or an Explaination of CDMA? I know it is part of a Cell Phone Protocol, however I want to try to write something using it.
Thanks
Steve
|
|
|
|
|
Google will give you over 28 million answers.
stevedobie wrote: write something using it
???
most platforms have it in their infrastructure. If you open and write to a socket,
your message will travel Ethernet or some other media, using CDMA without you
even caring about packet collisions...
|
|
|
|
|
CDMA - Code Division Multiple Access - Its a spread spectrum technique where by each user is given a unique code thus allowing optimal usage of frequency allocation (spectrum).
What do you want to write ? I have had alot of experience in WCDMA in the physical layer. So which layer of CDMA are you looking into i.e. In the world of WCDMA this corresponds to the physicial layer , RLC/MAC layer or RRC layer?
If you are targetting the physical layer then what exactly are you looking into the physical layer i.e. are you trying to develop a Cell Search Algorithm or a Rake Receiver etc.
Are you targeting a specific DSP/ASIC which your code will run on? If so then you are on the wrong forum and there is no way a .NET solution will run on a DSP or ASIC because writing CDMA/WCDMA alogrithms requires speed and the best way to do it is in C/C++/Assembler or build specific hardware modules (using VHDL) to implement your algorithms. Have you thought about what type of RTOS are you going to be using i.e OSE, Nucleus ?
From your post it seems that you have not done any research at all into CDMA and were expecting someone to tell you all about CDMA. As per the previous poster use google or look up IEEE Spectrum issues they have a million articles on CDMA. Sorry but stop being lazy expecting to be spoon fed an answer.
|
|
|
|
|
Hi people,
I am trying to find out a way in which I can be able to fill out an html form of an external website via a .net application. the html form uses a post method and its action is set to a java servlet.
Unfortunately I did not find so much help on the net and I hope that maybe some of you have experienced this kind of development before
Please do help me if you can.
Chris
|
|
|
|
|
You don't fill in the form. You just create the post data that the form would send to the server.
Use the HttpWebRequest or the WebClient class to post the data to the server.
An example of some post data, for three form fields:
name=Chris&answer=42&info=some%20text%20here
Use the Server.UrlEncode to encode the strings that you put in the post data.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you very much for your reply.
Does it make a difference if the site is Https:// and not http:// and if yes what extra processing should be done?
Thank you very much
Chris
|
|
|
|