|
Justin Perez wrote: why not just do the sending on another thread?
mmmm well that is what I'm trying to do, but I must update some of the controls on the form thus I require a delegate not so ??
Can you help me in this regard?
Thanks for the response
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
to keep your GUI alive while a lengthy operation is being processed, you need one or more extra threads (Thread, ThreadPool, BackgroundWorker). Each of those are not allowed to
touch a Control they did not create, to solve that you need to work with Control.InvokeRequired
and Control.Invoke(). You can Google these, or read one of several CP articles on the
subject. I have a smalle example at the end of my Sokoban article.
|
|
|
|
|
Hi,
Is there any way i can store hexadecimal value in a XML and process the document using XMLDocument class.
Code which has problem :
string msg912 = "3...32.076.987897.89012.3073";
msg912 = msg912.Replace('.', (char)28);
string xmlData = "<pre>";
xmlData += "<port>122</port>";
xmlData += "<financialmessage><![CDATA[" + msg912 + "]]></financialmessage>";
xmlData += "";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlData);
a exception is thrown on loading the XML using "xmlDoc.LoadXml". How can process the XML without replacing it.
Thanks in advance.
|
|
|
|
|
I'm guessing it has to do with the unclosed <pre> tag. I could be wrong, as I am not familiar with the CDATA tag you are using.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I would like to write a little helper app to identify pdf files in a shared folder that have been saved as version 1.5, as they should be 1.4 or earlier to be accessible to Acrobat Reader v5
I have been looking at using FileInfo - but I guess the metadata to identify the pdf version is hidden a little deeper?
Can anyone point me in the right direction?
|
|
|
|
|
Hi,
AFAIK PDF files start with an "eye catcher" string that contains the version number.
For 1.5 it is "25 50 44 46 2D 31 2E 35 0D" in hex byte values ("%PDF-1.5"+CR).
So you should open and read the first few bytes and compare.
|
|
|
|
|
//Works like a charm! Ta muchly!
//
Ignore my previous response! Having written and executed my little applet, I didn't get any results.
Which was odd, because I knew there were at least a few of these rogue files. On further investigation, it appears that the string says they are 1.4 - but are being reported on the properties-pdf tab as version 1.5. I'll dig a little deeper and get back to you.
modified on Friday, January 11, 2008 8:14:52 AM
|
|
|
|
|
Happy New Year Everyone!
Please help I am writing a code that searches the Active directory, it first get the list of properties, then use each property name to get its value. I filter the directory searcher by the cn. My problem is that for some people the search doesn't return the "mail" property, this is the property I need most. Please find my code snippet below.
DirectoryEntry de = new DirectoryEntry("LDAP://" + "AFLIFEDC04",
@"aflife\alsql", "perseus", AuthenticationTypes.FastBind);
string[] propertiesFound;
string Email = "";
DirectorySearcher ds = new DirectorySearcher(de);
//Use the users full name to get the email address from directory services
ds.Filter = "(cn=" + FullName + ")";
ds.SearchScope = SearchScope.Subtree;
try
{
SearchResultCollection results = ds.FindAll();
foreach (SearchResult result in results)
{
int a = 0;
ResultPropertyCollection propc = result.Properties;
DirectoryEntry dey = result.GetDirectoryEntry();
propertiesFound = new string[propc.Count];
// Loading all the properties return into the propertieFound array
foreach (string propertyName in propc.PropertyNames)
{
//This where the problem is, for some I get like 38 properties,
//for others I get 34. What is the cause of and what is the
//solution to it.
propertiesFound[a] = propertyName;
a++;
}
}
}
Thank you in advanced for your solutions.
Kind Regards
Mpumelelo Khuzwayo
khuzym
|
|
|
|
|
I ran into this problem a while back, but I don't remember what the problem was, and why you can't return the E-Mail property the way you do other properties. Anyway, here is the code I came up with the return the E-Mail property.
public static string getUserEMail(string fullname)
{
string email = string.Empty;
DirectorySearcher search = new DirectorySearcher();
search.Filter = "(cn=" + fullname + ")";
search.PropertiesToLoad.Add("mail");
try
{
SearchResult result = search.FindOne();
if (null != result)
{
email = (String)result.Properties["mail"][0];
return email;
}
else
{
return "Could not find Email address!";
}
}
catch (Exception ex)
{
return ex.Message;
}
}
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Good Morning Justin
Thank you for your reply, I have tried implementing it, the problem it returns the adspath property and not mail property. I don't know if you hav an idea what is the cause.
Thank you again.
I will keep on trying different things, I have a feeling the problem is very small!
khuzym
|
|
|
|
|
i want to use excel file values in my c# code,how can i get that??????
|
|
|
|
|
Member 4756709 wrote: i want to use excel file values in my c# code,how can i get that??????
Give a little more detail. What is it that you are wanting to do? What have you tried?
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hello,
How can i get IP addess of the computers connected with LAN?
Thank you
Dipak
|
|
|
|
|
and u're acting as a Client/Server
have u tried tcpcliecnt?
more inforamatio will help us to help u
Where there is a will
there is a way (yeh, right, hahaha)
|
|
|
|
|
Thank you for Reply
Yes i am as a client of that LAN. And i want to get all the IP Addresses and Names of the computers connected with the same LAN.
I have tried this way for test:
using System.Net;
String strHostName = Dns.GetHostName();
MessageBox.Show(strHostName.ToString());
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
MessageBox.Show(addr[i].ToString());
}
But it gets only My Computer's IP Address and another one IP address. I think it is mac address. I have put that IP Address on Run "\\121.245.75.159" but i opens my ShareDocs.
Please help me.
Dipak
|
|
|
|
|
Just an idea, but what if you get your own ip address (using the method you described), your own subnet mask[^], and then ping all the possible addresses within that subnet? The link (labeled "subnet mask" will also allow you to ping the other addresses as well). This will work assuming your subnet mask limits the number of possible ip's to a reasonable number (probably less than 2^8 is reasonable.) Hopefully someone else will offer a more efficient way to do this for you, but in the meantime this will work.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
You'll have to go through the entire range of IP addresses, PING each one to see if it responds, and if so, resolve that IP to its host name. There is no one function that you can call to give you the entire list.
|
|
|
|
|
hi
i want to add a eventhandler for a mshtml.ihtmlelement.could any one help me to do this please.
with regards
Balagurunathan.B
|
|
|
|
|
|
i am not getting wat you r trying to say
i just asked how to handle the events of mshtml.ihtmlelement using c#. i dint asked abt that msdn post
with regards
Balagurunathan.B
|
|
|
|
|
|
You should connect to SQL database[ADO.net] and use sql commands to make the changes on the database.
Check out this sample[^]
|
|
|
|
|
dear Manoj;
i'm using c# windows form not webform
|
|
|
|
|
Hi All,
Is there a way to Convert a string "Yes" to Boolean - or does this apply only to True/False, 1/0.
I've had a look at Parse, Convert.ToBoolean , and BooleanConverter , but no joy.
Thanks
J
|
|
|
|
|
string myString = "Yes";<br />
bool myBool = (myString == "Yes") ? true : false;
There is no automagic, built-in way, no.
|
|
|
|