|
Yes it sure looks that way, although he never said it explicitly.
So he should parse and either round or format, as ignrod suggested.
|
|
|
|
|
Luc Pattyn wrote: he should parse and either round or format
I disagree.
|
|
|
|
|
I am writing a program to send email. When I send from my own email accounts everything works! When I send from my company email or any other emails from the company I get the error: “The remote certificate is invalid according to the validation procedure”
The code looks like this:
<br />
mailObj = new SmtpClient("smtp. MyCompany.com", 25);<br />
from = new MailAddress("xxxxxx@MyCompany.com", "Chris H");<br />
AuthInfo = new NetworkCredential(from.Address, "xxxxxxxxxxx");<br />
to = new MailAddress("xxxxxxxx@hotmail.com", "Chris H");<br />
MailMessage mail = new MailMessage(from, to);<br />
mail.Subject = "Testing";<br />
mail.Body = "Hello Everybody";<br />
<br />
mailObj.UseDefaultCredentials = false;<br />
mailObj.EnableSsl = true;<br />
mailObj.Credentials = AuthInfo;<br />
mailObj.Send(mail);<br />
I have noticed that in our Outlook account settings - More Settings - Outgoing server we need to check the My outgoing server (SMTP) requires authentication and "Use same settings as my incoming mail server"
This would make me think my program should be able to get the authentication info need from the incoming mail server but how??
Any words of wisdom would be appreciated.
|
|
|
|
|
|
To confirm what Matt has said above, the company I work for has several domains but we use just the one certificate for IMAP SSL so the certificate fails on anything but the domain the cert is for. I use the RemoteCertificateValidationCallback delegate to examine any policy errors and disregard RemoteCertificateNameMismatch .
Check what yours is failing on and disregard if appropriate.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
I don’t see how to implement RemoteCertificateValidationCallback into my code. Our email is hosted by an outside company that is not very helpful so I don’t have access to their resources. All I have access to is my little program to help our salesmen respond to leads. This program would be run on the salesman’s PC while out of the office not on the ‘email server’. This may be the perfect response but I need a bit more guidance to see how to implement it.
|
|
|
|
|
If i recall correctly (I don't have the code here at home) all you need to do is add this before you enable SSL
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
and set up the method
private bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
bool result = true;
return result;
}
You'll need these usings if not already present
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hello again
im trying to merge two datatables as such
Table 1
row1 0 x x
row2 0 x x
row3 x 0 0
Table 2
row1 x 0 0
row2 x 0 0
row3 0 x x
merge them to
final table
row1 0 0 0
row2 0 0 0
row3 0 0 0
is there a way to do it (using merge?).i wont be able to use foreach or for loop (i think)as some of the rows are not in order ?
|
|
|
|
|
I like SQL for this using the UNION statement is that is an option.
|
|
|
|
|
|
SELECT
customerName,
createDate
FROM
customer
WHERE
createDate BETWEEN '2009-10-01' AND '2009-10-31'
UNION
SELECT
employeeName,
hireDate
FROM
employee
WHERE
hireDate BETWEEN '2009-10-01' AND '2009-10-31'
|
|
|
|
|
That's not what the OP is looking for. Union will merge the rows of the queries used, but will not merge any columns. The OP has 2 datatables that have different columns filled and he wants them merged into a single one.
SG
Aham Brahmasmi!
|
|
|
|
|
datatable1 = datatable2.Copy();
I know nothing , I know nothing ...
|
|
|
|
|
norjali wrote: i wont be able to use foreach or for loop (i think)as some of the rows are not in order ?
If the rows aren't in order, or if it doesn't have a Key, it's not reasonable expecting any inbuilt merge to work right? And no, there's currently no merge that can do this.
If you know the data better, try to find a candidate for a PK, that'll help you with your looping. Or look at the source of the data, a DB table perhaps? And see if that table has a Pk and try using that.
There's also a Join available for datatables, but you'd need a relation for that to work too.
SG
Aham Brahmasmi!
|
|
|
|
|
This is too customised. What do you mean by Row 0?
You will have to write a custom SSIS package or code.
|
|
|
|
|
Hi.
I have a program that runs as a scheduled task. The program runs on XP as SYSTEM.
The idea is that the program will run in the background, while USER is active.
I need the program to logoff USER when specific conditions occur.
I tried using
[DllImport("user32.dll")]
public static extern int ExitWindowsEx(int uFlags, int dwReason);
but that appears to not log USER off.
I think maybe it's logging SYSTEM off, as it is running as SYSTEM.
How can i logogg USER?
Thanks,
SummerBulb.
|
|
|
|
|
|
You can also invoke shutdown.exe with the /l option. But I believe any logged on user gets a prompt saying that SYSTEM is trying to log off. I think is is so that any user can save his work prior to being logged off.
SG
Aham Brahmasmi!
|
|
|
|
|
-Can someone help me create a setup project for an Excel add-in-
I created the add-in via VS 2010 (Visual C# -> Office -> 2010 -> Excel 2010 Add-In) and now need to create a set-up file such that when the user installs it, the add-in is automatically loaded into Excel.
This is what I tried: Creating a new Set-Up Project and adding "Project Output." That didn't work :'(
I know the add-in itself works because everytime I build it gets successfully loaded. Please help!
|
|
|
|
|
Hi all,
Using the Show() method of ContextMenu class ( in Windows.Forms ) it is possible to show a Context Menu. One of the arguments to the Show() method is the top left position of the Context Menu.
What I know is, instead of the top left position, the bottom left position of the Context Menu. I would like to translate this somehow to the top left position, however, neither ContextMenu nor MenuItem seem to have a Height or Size property.
Does anyone know how to fix the bottom left position of a Context Menu? Any help would be greatly appreciated. Thank you.
modified on Saturday, August 14, 2010 11:23 AM
|
|
|
|
|
You could use ContextMenuStrip to create your shortcut menus. That's interchangeable with ContextMenu and has several additional properties and methods including Height and Width.
SG
Aham Brahmasmi!
|
|
|
|
|
Thank you for your reply. The ContextMenuStrip has a Size property and can be used to place the Context Menu above the point I want to use.
Interestingly, the Size of the ContextMenuStrip is wrong the first time Show is called, so finally I used the method ContextMenuStrip.Show(PointToScreen(p, ToolStripDropDownDirection.AboveRight).
|
|
|
|
|
I'm sending mail with excel attchment and it's working fine when I run it from my local
machine. but if I try to access it from another machine it's giving me this
Error:
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
Error coming on first line of below code
Microsoft.Office.Interop.Excel.Workbook aBook;
Microsoft.Office.Interop.Excel.Application ExlApp = new Microsoft.Office.Interop.Excel.Application();
i have given all rights (http://blog.crowe.co.nz/archive/2006/03/02/589.aspx[^])
still error is coming
please help me out as soon as possible
|
|
|
|
|
It looks like your target machine does not have Excel or the interop libraries installed.
It's time for a new signature.
|
|
|
|
|
What exactly are you doing with the Excel objects? You certainly don't need excel to send an e-mail. If you are creating or modifying the spreadsheet before you send it, is it something you could do through the ODBC driver? Don't assume that anything outside of the System namespace will be installed on a server.
|
|
|
|