|
Hi!
Simple: You cannot (out of the box).
Take a look here[^] for a solution.
Regards,
mav
|
|
|
|
|
|
when i try to send an email it give me the following error:
"Could not access 'CDO.Message' object"
My code was:
EmailForm frm = new EmailForm();
if(frm.ShowDialog() == DialogResult.OK)
{
frm = null;
MailMessage mailObj = new MailMessage();
mailObj.From ="ME";
mailObj.To = to;
mailObj.Cc = cc;
mailObj.Bcc = bcc;
mailObj.Subject = subject;
MailAttachment mailAtt = new MailAttachment(Path);
mailObj.Attachments.Add(mailAtt);
mailObj.Body = "Body Text!!!";
mailObj.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = Dns.GetHostName();
try
{
SmtpMail.Send(mailObj);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"Error");
}
}
Can u help me on this.
thanks.
|
|
|
|
|
This could be an authentication issue. Try providing more details to the account you want to use to send the email. I have found this from Microsoft and it helped me. You may want to try it too:
try
{
string smtpServer = "mail.mystmpserver.com"; //your smtp server here
userName = "myaccount@mystmpserver.com; //your account info here
password = "mypassword"; //your password
int cdoBasic = 1;
int cdoSendUsingPort = 2;
MailMessage mail = new MailMessage();
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) ;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort) ;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);
mail.To = "emailaddress@server.com" ; // if you want to send it to multiple email address separate them using semicolon
mail.From = "emailaddress2@server.com" ;
mail.Subject = "Subject here";
mail.Attachments.Add("file here");
mail.BodyFormat = MailFormat.Html;
mail.Body = "<b>This is a bold text in the body of the mail.</b>"
SmtpMail.SmtpServer=smtpServer;
SmtpMail.Send( mail );
Label1.Text="Message Sending successful";
}
catch(Exception ex)
{
Label1.Text="Message Sending failed! Error: " + strerror ;
}
|
|
|
|
|
I am writing a simple event based socket thingy (not sure of the word), and I want the code to be as portable as possible, aka Mono. Mono has no Windows.Forms and I am using System.Windows.Forms.Timer, I am wondering if their would be a way to make my own timer (mabye using threading).
Thanks in advanced!
|
|
|
|
|
There is another Timer class in .NET. Try this one...
System.Timers.Timer
|
|
|
|
|
Mono now has Windows.Forms, they just are missing some of the advanced controls like DataGrid or the new .NET 2.0 controls.
|
|
|
|
|
Really? How do you access it? would it be a comand line option like: /reference:System.Windows.Forms?
|
|
|
|
|
Yes, it's a normal .NET assembly. Windows applications compiled with Microsoft's CSC will work using Mono (when they only use controls that are supported by Mono), no need to recompile.
|
|
|
|
|
Sweet, Thx! And It works very well in Windows, but my Gentoo died
|
|
|
|
|
hohsin01@yahoo.com.sg or hohsin10@hotmail.com
What's bad??? Pls help me, I do not have techar. Yor are ONE. Thanks!!!
Error 1 The type or namespace name 'IBankAccount' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Test012\Test012\Program.cs 24 33 Test012
Error 2 The type or namespace name 'IBankAccount' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Test012\Test012\Program.cs 57 32 Test012
using System;
using System.Collections.Generic;
using System.Text;
using Wrox.ProCSharp.OOCSharp.BankProtocols;
using Wrox.ProCSharp.OOCSharp.VenusBank;
using Wrox.ProCSharp.OOCSharp.JupiterBank;
namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balace
{
get;
}
}
}
namespace Wrox.ProCSharp.OOCSharp.VenusBank
{
public class SaverAccount : IBankAccount
{
private decimal balace;
public void PayIn(decimal amoount)
{
balance += amount;
}
public void Withcraw(decimal amoount)
{
if (balance >= amount)
{
balance -= amount;
return true;
}
Console.WriteLine("Writdraw attemp failed");
return false;
}
public decimal Balanc
{
get
{
return balace;
}
}
public override string ToString()
{
return String.Format("Veuns Bank Saver : Balace = (0,6:C)", balance);
}
}
}
namespace Wrox.ProCSharp.OOCSharp.JupiterBank
{
public class GoldAccount : IBankAccount
{
//Console.WriteLine("Writdraw attemp failed");
}
}
namespace Test012
{
class Program
{
static void Main(string[] args)
{
IBankAccount venusAccout = new SaverAccout();
IBankAccount jupiterAccount = new GoldAccount();
venusAccount.PayIn(200);
venusAccount.Withdraw(100);
Console.WriteLine(venusAccount.ToString());
jupiterAccount.PayIn(500);
jupiterAccount.Withdraw(600);
jupiterAccount.Withdraw(100);
Console.WriteLine(jupiterAccount.ToString());
}
}
}
----------------------------------------------------------------------------
Help me, you are one!!!
Error 1 Invalid token 'interface' in class, struct, or interface member declaration C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Test014\Program.cs 11 15 Test014
//Professional C# 2nd Edition -> Pg.128
using System;
using System.Collections.Generic;
using System.Text;
namespace Test014
{
class Program
{
pulic interface IBankAccount
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balance
{
get;
}
}
public class CurrentAcconunt : ITransferAccount
{
private decimal balance;
public void PayIn(decimal amount)
{
balace += amount;
}
public bool Withdraw(decimal amount)
{
if (balance >= amount)
{
balance -= amount;
return true;
}
Console.WriteLine("Withdrawal attempt failed.");
return false;
}
public decimal Balance
{
get
{
return balance;
}
}
public bool TransferTo(IBankAccount destination, decimal anount)
{
bool result;
if((result = Withdraw(amount))== true)
destination.PayIn(amount);
return result;
}
public override string ToString()
{
return String.Format("Jupiter Bank Account: Balance = {0.6:C}", balance);
}
}
static void Main(string[] args)
{
IBankAccount venusAccount = new SaverAccount();
ITransferBankAccount jupiterAccount = new CurrentAccount();
venusAccount.PayIn(200);
jupiterAccount.PayIn(500);
jupiterAccount.TransferT(venusAccount,100);
Console.WriteLine(vernusAccount.ToString());
Console.WriteLine(jupiterAccount.ToString());
return;
}
}
}
|
|
|
|
|
Eddy Ho wrote: namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount
{
void PayIn(decimal amount);
Do you see something wrong with this? A little spelling error perhaps?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Don't ever send an email to someone who doesn't ask you to. Keep this in the forums at all times.
Let me make it a little simpler. The error you're getting says that "The type or namespace name 'IBankAccount' could not be found".
Do you see something wrong here:
namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount <<<<<<<----- CLUE !!!
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balace
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 13:14 Saturday 14th January, 2006
|
|
|
|
|
Hello all!
I am using a C# program and would like to compress some files make zip file by coding. Can anyone provide some help. I look for msdn but not found.
Thanks All,
Tran Dung
-- modified at 21:49 Friday 13th January, 2006
|
|
|
|
|
|
Thanks for the reply but I figured it out. I have Visual C# 2005 Express and I had updated a project I had worked on several years ago. Anyway in looking thru the code I came across these 2 lines
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
I am not sure what the second one does, but the first one enables the xp styles. At least in Visual C# 2005.
|
|
|
|
|
Have you looked into MSDN[^]?
Sets the application-wide default for the UseCompatibleTextRendering property defined on certain controls.
|
|
|
|
|
I've create a form with some panel with an image as background, some textbox and label.
If load it all the controlls i just mentioned appear for a second black (during the painting event) then get the right aspect, panels show their picture, textbox and label their normal shape.
Why i get this? Programs like MSN that uses customized controls doesn't show them black.
(the problem i get also for normal controls)
I've tried yet using Backbuffer true.
|
|
|
|
|
Sasuko wrote: If load it all the controlls i just mentioned appear for a second black (during the painting event)
The painting event of what? Are you handling the painting event of the Panel control yourself? Are you using a large image (in bytes) for the background of the Panel control?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
they appear so during whatever pain event, on loading, if i resize the control and i hide for a little the control then i show it back, right in this moment the control is drawed again and i show its part in back...
If i run the program i want to see it all end drawed. Is it possible?
|
|
|
|
|
You didn't answer any of my questions.
But, what I think might be happening is your background image is being painted before your controls. Since your controls are drawn AFTER the background, the background is being drawn around the controls, leaving the black area for them to paint themselves into.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have an old c#.net project, the first version of .net, that I converted to c# 2005. I would like to change the controls to xp style. They appear as xp controls in the editor but when I build it they are the old style. Thank you for any help.
Mike Deming
|
|
|
|
|
u have just to create a .manifest file ad place it in the same directory of application.
Serch google for indication how to create a file like this (you have just to copy and past the code and change a little)
Name the manifest with the same name of the application associated:
myprogram.exe.manifest
Regards
|
|
|
|
|
Use the Application.EnableVisualStyles() before calling the Application.Run() in your main function. Dont forget to set the flat style to your controls like buttons,group boxes and so.
|
|
|
|
|
Hi,
Is there any way to hide the blinking cursor?
Thanks!
Mel
|
|
|
|