|
Your link for the image is broken.
Your generics got swallowed too.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Genius![^]
Write your codes into Java and post them in Java forum! Oh, don't forget C++, there are experts that can help you. Maybe some XAML and it becomes a WPF question?!!
Life is 5: 3 me, 1 you.
|
|
|
|
|
don't get it... is against the rules?
some people don´t use both languages u know...
|
|
|
|
|
Rules? No idea but read Simon Stevens's post, he explained well. Here[^]
Life is 5: 3 me, 1 you.
|
|
|
|
|
The problem
Using itextSharp to convert an html file to pdf and emailing it, I am unable to successfully parse an html file on the web server backend even when doing "absolute" or "relative" image referencing itextSharp fails and says "unable to find file c:\my_image.jpg" this is crazy didn’t specify c:\my_image.jpg as a path !!!
The madness of all this is it works well on my local file system, when the html file is located on asp.net using an IIS webserver i get the above described error.
Here is my code.
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head><br />
<title></title><br />
</head><br />
<body><br />
<table width="100%" border="0" cellpadding="1" cellspacing="5" style="font-size:10pt font-family:Arial, Tahoma"><br />
<tr><br />
<td colspan="2" align="right"><br />
<img src="logo.gif" /><br />
</td><br />
</tr><br />
</table><br />
</body><br />
</html><br />
<br />
<br />
asp.net code behind <br />
<br />
private void SendEmail(string attachmentName, string pdfDocumentHtml, <br />
string mailSubject, string mailBody, MailAddress fromEmailAddress, <br />
List<mailaddress> toMailAddressCollection)<br />
{<br />
Document doc = null;<br />
XmlTextReader reader = null;<br />
MemoryStream ms = null;<br />
MemoryStream msPdf = null;<br />
MemoryStream msHtml = null;<br />
try<br />
{<br />
<br />
doc = new Document(PageSize.A4, 10, 10, 10, 10);<br />
<br />
msPdf = new MemoryStream();<br />
PdfWriter.GetInstance(doc, msPdf); <br />
msHtml = new MemoryStream(new ASCIIEncoding().GetBytes(pdfDocumentHtml)); <br />
<br />
reader = new XmlTextReader(msHtml);<br />
reader.WhitespaceHandling = WhitespaceHandling.None;<br />
HtmlParser.Parse(doc, reader);<br />
ms = new MemoryStream(msPdf.ToArray());<br />
<br />
<br />
var attachment = new Attachment(ms, new ContentType("application/pdf"));<br />
attachment.Name = attachmentName;<br />
attachment.NameEncoding = Encoding.UTF8;<br />
MailMessage email = new MailMessage();<br />
email.From = fromEmailAddress;<br />
<br />
foreach (MailAddress address in toMailAddressCollection)<br />
{<br />
email.To.Add(address);<br />
}<br />
<br />
email.Attachments.Add(attachment); <br />
email.Subject = mailSubject;<br />
email.Body = mailBody;<br />
email.IsBodyHtml = true;<br />
SmtpClient client = new SmtpClient();<br />
client.Send(email);<br />
}<br />
finally<br />
{<br />
<br />
if (reader != null)<br />
reader.Close();<br />
if (ms != null)<br />
ms.Close();<br />
if (msPdf != null)<br />
msPdf.Close();<br />
if (msHtml != null)<br />
msHtml.Close();<br />
}<br />
}<br />
</mailaddress>
Thanks in advance
Wisdom is often meant as the ability and desire to make choices that can gain approval in a long-term examination by many people.
|
|
|
|
|
Anyone??
Wisdom is often meant as the ability and desire to make choices that can gain approval in a long-term examination by many people.
|
|
|
|
|
What does it code do? Can give me an example
String str;
str.TrimEnd(new char[0])
Thanks.
|
|
|
|
|
it will remove the \0 character from the string.
|
|
|
|
|
what do 'new' and 'char[0]' means?
Thanks
|
|
|
|
|
new is a keyword used to instantiate an instance of something
char[0] is an array of chars with zero elements.
This basic stuff is usually covered in the first few chapters of any beginner book on programming.
|
|
|
|
|
Really, if you need to know this I suggest you start a basic programming course.
|
|
|
|
|
public string TrimEnd(params char[ ] trimChars)
Member of System.String
Summary:
Removes all occurrences of a set of characters specified in an array from the end of this instance.
Parameters:
trimChars: An array of Unicode characters to be removed or null.
Return Values:
The System.String that remains after all occurrences of the characters in trimChars are removed from the end. If trimChars is null, white space characters are removed instead.
<br />
string myString = "myStringmmmm";<br />
string myNewString = myString.TrimEnd('m');<br />
<br />
Console.WriteLine(myNewString);
|
|
|
|
|
It means exactly the same as it did when you asked the question under another name on the 5th November.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Remember, remember the 5th of November.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
V (for Vendetta), if I remember correctly?
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Yes, I love that movie.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
It was really a good one. And the citation suited very well to what Ashfield noticed
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hello Everybody,
All I am trying to do is to call the wcf service which is hosted using windows service in another machine. The server certificate I have is generated using the makecert following the article http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Create%20and%20Install%20Temporary%20Certificates%20in%20WCF%20for%20Message%20Security%20During%20Development&referringTitle=How%20To%20-%20Use%20Certificate%20Authentication%20and%20Message%20Security%20in%20WCF%20calling%20from%20Windows%20Forms
I installed this certificate in trusted publishers rather than in Personal. I am able to call the service in the same(where the service is hosted) machine. When I copy the client to another machine and try calling this service, it returns this exception.
{"The remote server returned an unexpected response: (407) Proxy Authentication Required."}
this is how i referenced the webservice:
ServiceReference1.ServiceClient GetTablesSVC = new ServiceClient();
this is where it throws the exception
ds = GetTablesSVC.GetTablesToBeUpdated();
Any quick help is greatly appreciated
|
|
|
|
|
|
does it matter if i asked for help twice,i'm that desperate...i got deadlines,and i can't find a solution to my problem.
|
|
|
|
|
DotNetCoderJunior wrote: does it matter if i asked for help twice
Yes, its considered rude.
DotNetCoderJunior wrote: i'm that desperate...i got deadlines
Then pay for support rather than getting it free from volunteers.
|
|
|
|
|
Yes it does. Let me explain.
People here only read the forums they know stuff about. If you post in multiple forums, 2 different people may answer your question. This means one of those people has wasted their time giving you an answer, because someone else had already answered it but they didn't realise. Or if they do notice you've posted in multiple places, they have to waste their time like Pete has linking your posts together.
People here answer questions for free, so you should do your utmost not to waste their time. It is polite to post your question in just 1 forum.
The fact that your desperate and your problem is urgent doesn't make any difference. If you need an answer urgently you should phone MS tech support and pay for it. If you want an answer freely, bide your time and let someone answer it at their own pace when it's convenient for them.
Simon
|
|
|
|
|
Thanx for explaining,i appologise, i didn't at all intend on coming across as rude...i'm fairly new to development,i just wanted a little help from you experts,if i could afford to pay for suppoit i would,but unfortunatlely my finances does not allow me to do so...
|
|
|
|
|
i removed the other post,sorry again...
|
|
|
|
|