|
public static ArrayList EnumPrinters()<br />
{<br />
ArrayList ArrPrinters = new ArrayList();<br />
ObjectQuery oQuery = new ObjectQuery("SELECT * FROM Win32_Printer");<br />
ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oQuery);<br />
ManagementObjectCollection oReturnCollection = oSearcher.Get();<br />
foreach (ManagementObject oReturn in oReturnCollection)<br />
{<br />
if (oReturn["Name"] != null)<br />
{<br />
ArrPrinters.Add(oReturn["Name"].ToString().Trim());<br />
}<br />
}<br />
return ArrPrinters;<br />
}
I know nothing , I know nothing ...
|
|
|
|
|
hi ..
is there any way to encrpt a image n .docx file using c#
thnks
|
|
|
|
|
Here is an example for this on MSDN[^]
You could have saved a lot of time by using Google.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
yeah i m using google bt nt getting the rite stuff...
|
|
|
|
|
Encrypting the docx file as a whole does not look like an idea to you? (Unless of course you are willing to write your own app to display the encrypted docx file).
Search Google for C# AES.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi.
I have a windows service. I want to write an (C# .net) application that users run to communicate with the service. There is no restriction on .net version but security is important. What solution do you suggest?
I did a bit of research and found out named pipes and LRPC are good choices among other technologies. However it looks like in .net we'd better use WCF which, for IPC, supports named pipes. But WCF seems to have a steep learning curve. So I decided to ask you before I start to learn it.
Thank you very much for you help in advanced.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
I used WCF for exactly this purpose. There is a learning curve - mostly because of the number of configurable options exposed. I recommend "Programming WCF Services" by Juval Lowy - it's on Safari.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Nick Butler wrote: I recommend "Programming WCF Services" by Juval Lowy
Thanks. I found it here[^].
Thank you so much for your great help. I'll start reading in a few minutes.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
By the way, How was the performance? Does it support only named pipes for IPC?
I think there must be these information in the book but I can't wait to know them! Sorry.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
Performance was fine. It supports everything from named pipes to https.
You need the ABCs: Address, Binding, Contract. You can mostly mix and match these - I think I used a tcp binding as I needed to support remote access.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Thank you so much Nick. Your help is really appreciated. And thank you again for the book recommendation. It's a nice book. I hope to be ready to code the communication part within a few weeks (or less maybe.)
Thanks for all the help.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
Hi. I just wanted to thank you again for the book recommendation. What a nice book. I enjoy reading every line. Such books can't be found easily these days. It has been kind of you. Thank you very much.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
Thanks
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Ok, utterly sick and tired of this, his latest stunt is to falsely claim to be an "MVP (Microsoft Corporation)".
Surely, many if not all of you must have had enough of him as I. So I sent an email to Chris, and would ask that you do the same. Typically, I wouldn't mind as much, his stupidity has become all but to common on the forum, but the claim to be MVP (Microsoft Corporation) combined with completely false and erroneous (and potentially damaging) "responses" to other users threads can't be ignored. He has suggested everything from editing the registry IIRC, along with uninstalling the .NET Framework altogether.
This is obviously something we wouldn't want this user to say to potentially serious beginners, especially under the false pretenses of being an MVP (Microsoft Corporation).
|
|
|
|
|
Check out the sig "Always ready to be helped and be helped...." Nice.
Although I don't appreciate the extra topic in the forum about the guy. It's more than he deserves.
Truly, if you have a serious problem with a member of the forums you should just e-mail Chris. There's no need to make a spectacle of it.
Even if the person in question deserves it.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I cannot believe he claimed something of that sort. For the love of God, I'm going to take this forward to the MVP lead of South Asia (this Rajdeep dimwit seems to be living in India). I'm taking this personally and see if I can have MS to rig his filthy arse legally.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Either he is too bad with geography or some multiple personality disorder problem.
Rajesh R Subramanian wrote: this Rajdeep dimwit seems to be living in India)
Check my sig.
|
|
|
|
|
Thank God for he isn't an Indian.
Bangladesh still comes under the South Asia MVP province and hence the South Asia MVP lead can do something better than the other MVP leads.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I am SO glad!
Cheers,
Vikram. Recent activities:
TV series: Friends, season 6
Books: Freakonomics, by Steven Levitt and Stephen J Dubner. Carpe Diem.
|
|
|
|
|
|
Hi Bros,
I have noticed in certain trial applications, that after a specific amount of use, the app. just fails to process requests any further since the trial period gets expired.
However, in my application, I want that if the date of executing the application is 15 /* just for instance */ then, something like this should happen:
if (current.date=15)
{
}
else
{
}
Any ideas how to do this in C#? Help will truly be appreciated!
Rajdeep Bhattacharjee,
MVP (Microsoft Corporation)
Always ready to be helped and be helped....
|
|
|
|
|
If (DateTime.Now.Date == 15)
{
}
you need to execute this at the application startup.(i.e. the Main() method)
Rajdeep.NET is BACK wrote: Rajdeep Bhattacharjee,
MVP (Microsoft Corporation)
Well, MVP is symbol of appreciation which is given to people for the expertise and community work.
Please do not degrade it. Its no fun.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Wow, you still can't use Google[^] even when you're a Microsoft MVP. Grow up.
My failometer has shot off the end of the scale!
I seem to have misplaced my ban button.. no wait... found it!
|
|
|
|
|
He is not allowed to use Google, and Bing hasn't been released yet.
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.
|
|
|
|
|
The following is a short list of things Chuck Norris cannot Rajdeep.NET can do: .
My failometer has shot off the end of the scale!
I seem to have misplaced my ban button.. no wait... found it!
|
|
|
|