|
Hello everyone. Is there a way to export Outlook contacts from the Exchange server? I have written some code to extract the contact information through the local Oulook;however, I find it rather diffucult to apply this to the exchange server 2003. I need to export all contacts.
The reason behind this is we are making a white list at work to allow incomming emails, the problem is we have to assign someone in IT to manually export our executives contacts on a weekly basis to produce this white list.
Is there anyway around this?
thanks in advance
|
|
|
|
|
What might be the easiest way to remove all non-alphanumberic values from a string?
|
|
|
|
|
|
I am not that familar with RegEx. Can this been done with one replace call? Do you have an example?
|
|
|
|
|
This seems to work fine for me
string x = "123ABCD;233-";
x = System.Text.RegularExpressions.Regex.Replace(x, @"[^\w]", "");
This prints 123ABCD233;
You can Google for regexes that match more/less characters as you want.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks.
That was exactly what I was looking for.
|
|
|
|
|
Hi,
My program generates a log file for every event that happens in the program. So, I open the file and keep it open till the end. This is how I open the file for writing:
<br />
public CLogHandler()<br />
{<br />
this.m_fsLog = new FileStream(strTodaysLogFile, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.Read);<br />
this.m_swLog = new StreamWriter(this.m_fsLog);<br />
if(this.m_swLog != null) this.m_swLog.AutoFlush = true; <br />
}<br />
<br />
pubic WriteLogMessage()<br />
{<br />
if(this.m_swLog != null) this.m_swLog.Write("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + aMsg + Environment.NewLine);<br />
}<br />
One of the requirements is to display the current log file contents in a child form. So, I open the log file for reading like this :
<br />
System.IO.FileStream fs = new FileStream(this.m_strCurrentFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);<br />
System.IO.StreamReader sr = new StreamReader(fs);<br />
<br />
while(sr.Peek() > -1) this.DisplayLogText(sr.ReadLine() + Environment.NewLine);<br />
<br />
fs.Close(); <br />
As you see, when I open the file for writing, I'm granting FileShare.Read, which means other processes can open the file for reading. But when I try to open the file for reading, it gives IOException that the file is being used by another process.
So, how can we write and read to and from a file simultaneously in the same program (ofcourse, without stopping the write process)??
Cheers
CNU
|
|
|
|
|
The title says it all. I need to know if there is anyways to make a "copy" of a reference type.
So basically i want to know if there is a way to make a Reference Type variable act like a value type variable.
Or is the only way copy a reference type is to create a new one and then move all the info out of the old one into the new
Thanks for your help!
|
|
|
|
|
It depends on the class of the variable. Some classes define a constructor that take another instance of the same class as a parameter. There's also a MemberwiseClone method, but note it's a protected method. Take a look at the ICloneable interface too.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
YawgmothIII wrote:
Or is the only way copy a reference type is to create a new one and then move all the info out of the old one into the new
That's how you do it. However, there are many ways to do that,
1. You can use MemberwiseClone.
2. Your object can implement ICloneable, implement the Clone method and do the copying there
3. You can use a nifty trick, serialize and deserialize the object back, you'll get a new copy and .NET handles all the copying for you.
private object Copy(object original)
{
using (MemoryStream ms = new MemoryStream())
{
BinaryFormatter fs = new BinaryFormatter(original.GetType());
fs.Serialize(ms, original);
return fs.Deserialize(ms);
}
}
Regards
Senthil
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
3.
As I think he doesn't know serialization very well I would add the info that the class being copied needs to be marked as Serializable or implement the ISerializable interface.
|
|
|
|
|
int intJ = (int) o;
where o is an onject of Integer kind
venkat
|
|
|
|
|
1)To personalize the uninstall icon that is showed in install/uninstall programs, how i can do?
2)I need to make more "xp styled" the install wizard forms, for example the progress-bar is flat style, i want to see the xp one. How? Some button is much big, i want to reduce. how?
3)if i make right-click on the desktop shortcut for my application .exe and i go in property window, i can see the Destination target but the button "Find Destination" is disabled, why?
|
|
|
|
|
1)To personalize the uninstall icon that is showed in install/uninstall programs, how i can do?
You have to provide icon file in setup project properties.
- ashish
|
|
|
|
|
Sasuko wrote:
2)I need to make more "xp styled" the install wizard forms, for example the progress-bar is flat style, i want to see the xp one. How? Some button is much big, i want to reduce. how?
You can do
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
For more information, look here[^].
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi i have 2 perform xml parsing of IIS log files using C# can someone plz guide me tht what 2 study for this purpose as i hav to do it within three days and i kno less about C# .if someone can also provide me its relative code plzzzzzzzzzzzzzzzzzzzzzzzzzz.
waitin 4 some positive response very soon.
|
|
|
|
|
|
hi i wanna ask u tht its hard to perform xml parsing of IIS files which are kind of text files but not impossible rite?
it seems tht u hav worked a lot in C# plzzzzzzzzzzzzzzz guide me how 2 do tht n the link which u hav sent i wann ask wat u r tryin 2 do in tht prject but most importantly kindly help me in parsing hope 4 very positive response n very soon.
|
|
|
|
|
|
|
thx for the help that really helped!
|
|
|
|
|
I am trying to get a second response from a Webrequest. The server that I am talking to works as follows.
First here is my code:
string postData = "";
Uri myUri = new Uri("http://208.XXX.XX.XXX:10224/?ReturnAddress=209.XX.XX.XX/recvpost.php");
HttpWebRequest h = (HttpWebRequest)WebRequest.Create(myUri);
h.Method = "POST";
h.ContentType="text/xml";
h.ContentLength=postData.Length;
Stream newStream = h.GetRequestStream();
newStream.Write(byte1,0,byte1.Length);
newStream.Close();
WebResponse resp = h.GetResponse();
StreamReader reader = new StreamReader(resp.GetResponseStream());
string str = reader.ReadLine();
while(str != null)
{
Console.WriteLine(str);
MessageBox.Show( str );
str = reader.ReadLine();
}
resp.Close();
1) Send your request, when received the replay "OK" will be sent.
2) Once the server has the request ready it will send the reply.
3) I am receiving the OK but nothing else.
How do you get secondary responses?
|
|
|
|
|
What do you mean by a second response? Each request can have only one response.
---
b { font-weight: normal; }
|
|
|
|
|
I was told by the server provider to send a Webrequest with the above mentioned header information. When the server receives the request it will send the OK reply, and then break the connection. When it has the reply ready it will call back on the ip address provided in the Uri and send the file noted in the Uri recvpost.php.
Uri myUri = new Uri("http://208.XXX.XX.XXX:10224/?ReturnAddress=209.XX.XX.XX/recvpost.php");
So, I guess I am asking how to I listen for that reply?
|
|
|
|
|
Ok you must be receiving as response code.. you have to receive webresponse stream to get the response form the requested uri.
- ashish
|
|
|
|