|
Is it possible to create a word document on the fly and send as attachment with a email using SmtpClient?
Incase it is possible, do we need to have MS word installed on the machine where the mail send utility is running.
Thanks in advance.
- ashish
|
|
|
|
|
Hi,
We can create word documents on the fly C# or VB.Net by using Interop.Microsoft.Office.Core and Interop.Word references .NET internally using com Interoperability. Once the document is being created that can be attached through a mail. Refer the following URL to create word document.
For Word Document
http://msdn2.microsoft.com/en-us/library/78whx7s6.aspx
For Email
http://www.systemwebmail.com/faq/2.3.aspx
Ram
|
|
|
|
|
Hi everyone,
I'm trying to write a simple program that reads paths from an xml file and then display thumbnails in a panel. While a user may resize the form I thought I should recalculate and redraw the thumbnail list because -for instance- in the default view we have three columns but when the user maximize the window we need lets say 6 columns.
So I try to get every child control -in this case pictureBox- with a foreach loop, and then dispose them. But weirdly when I resize the form only the 1st and 3rd column disappears, and when I resize it again the the 4th column dissapears, and again a resize 1st-3rd-5th...rows disappear of the 2.n column and so forth. I tried to debug and trace what can cause this weird behavior but find nothing.
I also tried the Remove() method for ControlCollection but its the same sh*t.
Here is my code :
private void onFormResize(object sender, EventArgs e)<br />
{ <br />
foreach (Control c in panel3.Controls)<br />
{<br />
panel3.Controls.Remove(c);<br />
} <br />
}<br />
Anyone have an idea ?
PS : Also is there another more "handy" method to make the column count fit the just-width of the panel ?
Best regards..!
.:: Something is Wrong ::.
|
|
|
|
|
Remove(c) changes the collection of the foreach loop.
Try this:
while(panel3.Controls.Count > 0)
{
panel3.Controls.RemoveAt(0);
}
|
|
|
|
|
pashje wrote: but its the same sh*t.
Rather than get angry with the world perhaps you should read the documentation. It says that you should not alter the thing your are iterating over from within a foreach loop. The reason is that the results are unpredictable.
If you want to remove all the controls in a panel then why not do something like this:
panel3.Controls.Clear()
If you want to do other stuff as you remove them then something like this would work:
while(panel3.Controls.Count > 0)
{
Control c = panel3.Controls[0];
c.Dispose();
panel3.Controls.RemoveAt(0);
}
-- modified at 7:48 Tuesday 8th August, 2006
|
|
|
|
|
I can swear that I tried
panel3.Controls.Clear()
but intellisense didn't show any Clear() method..
and also sorry I was a bit(!) overreacted after 13 hours in front of the computer
the problem is solved.. this weirdness was because of while I iterate with the foreach, I dispose the control at index 0 and the collection shift left, so again I have another control at index 0 but now I am at the second loop which means the index is 1 the control shifted to index 0 will not disposed.. so everytime I resize my form only the odd ones will disposed..
it is interesting to use and maybe this weirdness will be usefull for some other application
anyway.. thx for ur helps, I much appreciate that !
.:: Something is Wrong ::.
|
|
|
|
|
Hi All
Wht are all the steps to convert a class file into dll.
and how to use the dll in various applications.....
Thanks
Paul
|
|
|
|
|
|
|
Hi guys,
I am a team member of web server development.
I want to make a TCP connection between web server and my client, whare my client is behind proxy.
Can any one tell me is it possible.
waiting for reply.
Kamlesh
Software Developer.
|
|
|
|
|
See your previous question.
It's no need to create a new username and post the question again.
|
|
|
|
|
Another member of his team perhaps leppie visualizes:
Screaming boss: Stop everything, and everyone look for that answer now!!!!
|
|
|
|
|
I am having dejavu, or one of your team members just asked the same question 2 posts below...
|
|
|
|
|
How do I call name from
private void send(string name, string surname)
so that I can also use it in my form load
private void Form1_Load(object sender, System.EventArgs e)
|
|
|
|
|
public static void send(string name, string surname)<br />
.<br />
.<br />
.<br />
<br />
private void Form1_Load(object sender, System.EventArgs e) <br />
{<br />
send("Name","LastName");<br />
}
|
|
|
|
|
I actualy need to write only the name in the text file like
streamWriters.WriteLine( System.DateTime.Now + " name is " + send.name );
how can I call only name.
|
|
|
|
|
public static void send(string name, string surname)<br />
{<br />
}<br />
<br />
public static void send(string name)<br />
{<br />
string n = name;<br />
return n;<br />
}<br />
<br />
<br />
private void Form1_Load(object sender, System.EventArgs e) <br />
{<br />
streamWriters.WriteLine( System.DateTime.Now.Tostring() + " name is " + send(name) ); <br />
<br />
}
|
|
|
|
|
is it possible to run an application which has been developed in C#, on a machine which doesn't has framework installed on it?.
satz32
|
|
|
|
|
No, thats like trying to make car drive on water. It wasnt meant to, it wasnt built for that purpose.
|
|
|
|
|
The possibilities are:
1. .NET Framework installed
2. without .NET Framework but you must link your program using this:
http://www.remotesoft.com/linker/
|
|
|
|
|
if your C# Application have to run in machine in which is not connected with internet you 'must' install framework.
|
|
|
|
|
Hi Guys,
I am been a member of the team developing a WebServer.
I wanna want to know that is it possible to make a TCP connection to the webserver wherein my client is behind the proxy.
Does this condition looks Feasible ?
Kindly looking for an reply.
girish
Girish
Software Developer
|
|
|
|
|
I don't think so. You need a direct connection.
That is the meaning of proxy, to block direct connection.
TcpClient -> no
HttpWebRequest -> yes (http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.proxy.aspx)
|
|
|
|
|
From a server point of view, as long as the proxy is working, it should be transparent. But I suspect you wont be able to use TCPClient from the client, but rather WebClient or HttpWebRequest.
|
|
|
|
|
Yes it is possible as far as ur server contail real IP. Doesn't metter where is the client.
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|