|
Why didn't you use Google for this question? Seriously, why? It's taken you longer to ask this question than it would have taken for you to google pfx file. It's a personal information exchange key, and contains a public and private key. One place you need this file is in ClickOnce.
Seriously though - Google it and read up on it. It does so much more.
|
|
|
|
|
Hi,
everybody how can merge three liste Of int in csharp.
Exemple:
List<int> Audios;
List<int> Videos;
List<int> Books;
list<int> All;
the list ALL must contains the merge of the three list, the question is can we do with out using foreach statment for the thre list.
thankx
|
|
|
|
|
you can use the AddRange method to add the whole of one list's contents to another.
List<int> Audios = new List<int>();
List<int> Videos = new List<int>();
List<int> Books = new List<int>();
List<int> All = new List<int>();
All.AddRange(Audios);
All.AddRange(Videos);
All.AddRange(Books);
Simon
|
|
|
|
|
papy-boom wrote: the list ALL must contains the merge of the three list, the question is can we do with out using foreach statment for the thre list.
Well, you can call methods that does it for you, but there is no way to merge entire lists. The items has to be added one at a time whichever method you use.
The most efficient way is to create a list with a specific capacity, that way it doesn't have to be resized while the items are added:
List<int> all = new List<int>(audios.Count + videos.Count + books.Count);
all.AddRange(audios);
all.AddRange(videos);
all.AddRange(books);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi All
I’m trying to make a list view to catch multithreads. I have a tree view on the right and the list view at the bottom. i want to find out how to display what has been open in the MDI. E.g. if I open a form called email using the treeview I it should display the details that I opened the email form in the list view. It is something like Microsoft Dynamics SL -Solomon
I am very new at c#
|
|
|
|
|
Do you mean you do something on the form (or the TreeView), and then some backend processing happens in a thread and when the results come the ListView gets updated? If so, use BackgroundWorker helper class in the System.ComponentModel namespace.
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
I want to get RTC(Real time clock) time in c#.
How can i do that? Thank for your answer.
|
|
|
|
|
|
I think System.DateTime.Now is OS time not RTC time.
|
|
|
|
|
Where do you think the OS gets it's time from?
The RTC is a bit of hardware that keeps track of the time while the PC is powered off. When the PC is powered on again, the time in the RTC is loaded and used by the OS.
Depending on the OS, it may then rely on the RTC to count the time, and make a call to the hardware when over the time is needed, or it may keep track of the time using itself a software clock/counter.
Either way, the value you get returned to you is the current time as far as the system as a whole is concerned. There is no need to distinguish between "OS time" and "RTC time" one is simply used to back the other.
Unless you have a very strange and unusual requirement where you must have the actual hardware RTC value, just use DateTime.Now.
Simon
|
|
|
|
|
I have the follwing Problem. We have developed an application for a mobile device using windows mobile 5 as operating system. In the next step we want to install new versions of the software but we neet to uninstall the old version first. Since we don't have Active Sync all the time, and we don't want the user to uninstall the software over the systems>remove programs.
I'm just looking for the exe which is capable of removing applications from the mobile device, similar to msiexec.exe on other windows based systems. And then using c# code to remove/uninstall the application.
Any ideas?
|
|
|
|
|
Hi..
I need to get the List of all the user Name from Active Directory, i used the following code.
try{
ADEntry = new DirectoryEntry("LDAP://" + Session["DominName"].ToString() + ".net", txtUserName.Text.ToString(),
txtPassword.Text.ToString(), AuthenticationTypes.Secure);
nativeObject = ADEntry.NativeObject;
}
catch (Exception)
{
DirectorySearcher mySearcher = null;
mySearcher = new DirectorySearcher(ADEntry);
mySearcher.SearchRoot = ADEntry;
mySearcher.Filter = "(&(objectClass=USER))";
mySearcher.SearchScope = SearchScope.Subtree;
mySearcher.PropertiesToLoad.Add("SAMACCOUNTNAME");
mySearcher.PropertiesToLoad.Add("cn");
mySearcher.PropertiesToLoad.Add("mail");
SearchResult srh = null;
srh = mySearcher.FindOne();
int intSerialNo = 1;
foreach (SearchResult resEnt in mySearcher.FindAll())
{
resEnt.Properties["SAMACCOUNTNAME"][0].ToString();
resEnt.Properties["cn"][0].ToString();
resEnt.Properties["mail"][0].ToString();
}
But it is listing Max 1000 users details but there are 2000 entries in the ADS under "user" group..<br />
<br />
<br />
Please anyone Help me to get the list of all the 2000 user's list in ADS..<br />
<br />
if there is a limitation for LDAP protocol.. Can any one suggest other protocol, i tried with WINNT, NDS and IIS also..<br />
<br />
<br />
|
|
|
|
|
Yes, LDAP has a limit of 1000 result for a single search. To avoid that you must perform a paged search.
To do that, just set the PageSize property of the DirectorySearcher object to a value greater than 0 (e.g. 500 or 750) before calling the FindAll method.
The MSDN documentation for that is Here[^].
|
|
|
|
|
Thank you very much Mirko.
regards
skvs
|
|
|
|
|
Hi friends,
I have a RichTextBox control, and read a part of a file into a MemoryStream and then load that in my RichTextBox, here's my code:
void FillRTB(string filepath)
{
MemoryStream memStream = new MemoryStream();
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.ReadWrite);
byte[] ByteRead = new byte[1];
for(int i = 0; i < 300; i++)
{
fs.Seek(i, SeekOrigin.Begin);
fs.Read(ByteRead, 0, 1);
memStream.WriteByte(ByteRead[0]);
}
rtbText.LoadFile(memStream, RichTextBoxStreamType.PlainText);
}
But rtbText shows nothing! I have no error too!
Any idea? Thank you.
While (true) { Human.isLearnable = true; }
|
|
|
|
|
How about this?
void FillRTB(string filepath){
byte[] ByteRead = new byte[300];
using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.ReadWrite))
{
fs.Read(ByteRead, 0, 300);
}
MemoryStream memStream = new MemoryStream(ByteRead);
richTextBox1.LoadFile(memStream, RichTextBoxStreamType.PlainText);
}
modified on Monday, October 20, 2008 4:37 AM
|
|
|
|
|
Well, I had error, "The name 'fs' does not exist in the current context"
I tried this:
void FillRTB(string filepath)
{
byte[] ByteRead = new byte[300];
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.ReadWrite);
fs.Read(ByteRead, 0, 300);
MemoryStream memStream = new MemoryStream(ByteRead);
rtbPage.LoadFile(fs, RichTextBoxStreamType.PlainText);
}
and yes, it works, Thanks. But what if I have a dynamic length? Ex:
void FillRTB(string filepath, long Characters);
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Pedram Behroozi wrote: The name 'fs' does not exist in the current context
Sorry about that. It is fixed.
Pedram Behroozi wrote: But what if I have a dynamic length? Ex:
Unless you don't know how much to read, how can you do it? You have to pass length to FillRTB method.
|
|
|
|
|
Can I dynamically get the length?
void FillRTB(string filepath, long length);
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Pedram Behroozi wrote: Can I dynamically get the length?
I didn't get you. What do you mean by dynamically getting the length?
|
|
|
|
|
Sorry, My Bad English...
I mean how can I implement this:
void FillRTB(string filepath, long length);
I mean how can I have a variable with dynamic length?
Sorry again
While (true) { Human.isLearnable = true; }
|
|
|
|
|
void FillRTB(string filepath,long length)
{
byte[] ByteRead = new byte[length];
using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.ReadWrite)) {
fs.Read(ByteRead, 0, ByteRead.Length);
}
MemoryStream memStream = new MemoryStream(ByteRead);
richTextBox1.LoadFile(memStream, RichTextBoxStreamType.PlainText);
}
|
|
|
|
|
Thank you very much. That's work...
N a v a n e e t h wrote: byte[] ByteRead = new byte[length];
I thought we can't declare variables like this. And actually I didn't test that
Thank you again
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hi all,
I am trying to export image to PDF file using iTextSharp dll.
I created a PDF file(test.pdf) and added image to that pdf file. But the problem is when the image is too large ,its not showing the complete image in pdf file.
when the image height is large, i am automatically getting the vertical scroll bar in pdf file. but for width i am not getting any horizontal scroll bar.
Please suggest me how to export large images to pdf file without resizing the image. I s there any way to get the horizontal and vertical scroll for PDF file.
Thanks in advance
|
|
|
|
|
Hi.
I Build Report In C# Windows Application , and this Report Is Build His Columns By Dynamic Criteria, May be the Number of Columns In it is 5 or 7 or 13 or 20 or other , and I won’t to put this columns in the report as a good way , the all columns is Clear of the User , i add the columns at every number of it , but if the number is more than 7 columns the columns is not show in the Report is Hidden , then I calculate the width of Report and The Width of the max text in every columns and Other Options may be Decrees the Size of Font if the Columns Number is or Increase the Font , these Operation Depend On Number OF Columns .....
The Problem Is in Type of Screen, the Report is good if the Screen 15 but if screen is 17 the Report is Show in Not Good Way.
Who I can solve this Problem, and what is the Unite Of width the text and width of report (Cm, Inch …., Unites).
Thanks for any body help me
Thaer
|
|
|
|