string body = ""; body += ""; body += " this is some HTML text"; body += " "; AlternateView alternate = new AlternateView(body, MediaTypeNames.Text.Html); message.AlternateViews.Add(alternate);
I'm trying to send an email with html format but I get "illegal character in path error" when I create the alternative object. I get this code from the .NET Framework Class Library, can somebody help me please? I tried to create an html string myself but the errore is the same. thanks a lot -- modified at 9:38 Monday 17th July, 2006
tiziacaia
Posts
-
illegal character in path error [modified] -
NotifyIcon problemI'm sorry! This is the code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.Text; using System.Drawing; using System.Data.SqlClient; using System.Windows.Forms; namespace Warning { public partial class Warning: ServiceBase { private System.Timers.Timer m_tTimer; private SqlConnection sqlConn; private SqlCommand sqlCmd; private SqlDataReader sqlReader; private string strSql; public Waning() { InitializeComponent(); } protected override void OnStart(string[] args) { m_tTimer.Enabled = true; m_oNotifyIcon.Visible = false; } protected override void OnStop() { m_tTimer.Enabled = false; } protected override void OnContinue() { } private int GetNewRequestes() { int newRequestes=0; //System.Diagnostics.Debugger.Break(); sqlConn = new SqlConnection("DATABASE=DBNAME;SERVER=DBSERVER;user id=user;password=xxx;"); strSql = "SELECT COUNT(*) FROM DBTable WHERE StatusID=5"; try { sqlConn.Open(); sqlCmd = new SqlCommand(strSql, sqlConn); sqlReader = sqlCmd.ExecuteReader(); sqlReader.Read(); newRequestes = sqlReader.GetInt32(0); sqlReader.Close(); } catch (Exception err) { string msg = err.Message; } finally { sqlConn.Close(); } return newRequestes; } private void m_tTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { int newRequestes = 0; //System.Diagnostics.Debugger.Break(); newRequestes = GetNewRequestes(); if (newRequestes>0) { m_oNotifyIcon.Visible = true; m_oNotifyIcon.ShowBalloonTip(60, "There are "+newRequestes.ToString()+" new requestes!", " ", ToolTipIcon.Warning); } else { m_oNotifyIcon.Visible = false; } } } }
Any idea? Thanka a lot! -
NotifyIcon problemHallo, I make a windows service that check new entry in a database table, if there are new entries the service show a notify icon in the system tray. all works fine but when the system tray show my icon, some applications crashes and stop to work (e.g: cics) Any suggest for me? Thanks a lot. (I hope you understand me, me english is not so good.)
-
web service and class fieldsIn a web service I have a class with some boolean fields; in the client application I don't understand because for each boolean class field I have a "specified" field too. for example if the web service class has a field called rights, in the client application seems that in the web service class I have a rightsSpecified field too; the strange is that i musst refere to the rightsSpecified variable to get the real value of rights. (if by default rights=false and I change in rights=true, rights values is always false but rightsSpecified become true) can somebody explain me about this? thanks a lot! -- modified at 7:07 Monday 17th October, 2005
-
web service object serializationI have a web service class with some fields that I want they will be serialized like element and some others like attributes. I don't understand why only ONE attribute will be seriarilized (serialization that become from a cliant application that use the web service). for example: class test{ [XmlAttribute] public string id; [XmlAttribute] public bool rights; [XmlAttribute] public int nr; [XmlElemens] public string rule; [XmlElemens] public string test; ... } will serialized like this: hello hello how you can see there aren't the attributes "rights" and "nr". can somebody help me please? thanks a lot -- modified at 4:09 Monday 17th October, 2005
-
web services boolean attributeI'm sorry but i still have the problem. can somebody help me please?
-
web services boolean attributeThaks a lot for the reply, my object is not simple like that, but I don't think there is somethings that cause the error (I haven't any problems with the rest), my problem is only for boolean attribute. I just want serialize my XXX object in the web application that use the web service (I yet have a referenze in the application). I repeat all works perfectly but if I add the [XmlAttribute] tag to a boolean fields, this don't will be serialized. Thanks
-
web services boolean attributeI write a web service with a boolean attribute: public class XXX { [XmlAttribute] public bool yyy; ... .... } I dont' understand why the field yyy isn't serialized. If I omit the [XmlAttribute] all works fine but yyy become clearly an element. can somebody help me please? I'm sorry for my english, I hope you can understand.
-
problem with crystal report viewer (10)I have 2 problem with the viewer of crystal report: the first is that the report is displayed only for an horizontally half page, and the second is that the report display always only the first and the second page (but the report has 89 pages!!!). can somebody help me please? thanks a lot!
-
get session variablesit's possible to get the name of session variables of a page using the c# classes HttpWeb*? or there's any another way? thanks a lot
-
personal assemblies, copy local to falsethanks for the reply but i solved. i put in the project web.config these lines: and all work correctly without register the dll in the gac.
-
personal assemblies, copy local to falsethanks for the reply but i solved. i put in the project web.config these lines: and all work correctly without register the dll in the gac.
-
personal assemblies, copy local to falsehello! i loaded my private dll in my project references and after i set this property "copy local" to false (because is a shared library). when i try to run my application i get this error: "File or assembly name MyDll, or one of its dependencies, was not found." in some precedents projects I done this and work without register the dll in the gac. somebody can help me, please? thanks a lot! (if i set"copy local" to true all work correctly)
-
remove autopostback from buttonthanks thanks thanks a lot! I choose the second way.
-
remove autopostback from buttonhow can I remove autopostback from a button? i want change the document location cliccking on the button but my location don't change. I don't understand why! somebody can help me? happy new year to all and thanks a lot for help! -------------->here my code of html: <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %> WebForm1 function change(){ alert("qui"); document.location.href="ciao.htm"; }
-------------->and here the codebehind: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace WebApplication2 { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.DropDownList DropDownList1; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here Button1.Attributes.Remove("AutoPostBack"); Button1.Attributes.Add("OnClick","change();"); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } }
-
htmlhelp visual studio .netwhere i set the link to the library htmlhelp.lib? thanks and merry christmas
-
htmlhelp visual studio .nethow can i work with htmlhelp in visual studio .net (visual C++)? i want use ::HtmlHelp() but when i compile i get the error: Fatture error LNK2001: unresolved external symbol "struct HWND__ * __stdcall HtmlHelpA(struct HWND__ *,char const *,unsigned int,unsigned long)" (?HtmlHelpA@@$$J216YGPAUHWND__@@PAU1@PBDIK@Z) somebody can help me please? thanks a lot
-
very strange session problemi have a page with a session variable setted by a Request.Params.Get(...). i open this page from another window using window.showmodaldialog(...). my problem is that when i want get the value of my session variable i get the error session expired! the strange things is that if i use window.open(...) instead window.showmodaldialog(...) all work correctly and i have value in my session variable! somebody can help me??? thanks a lot!
-
how to fill a combobox with datatadapterfor examples with c# we can do somethings like this: string sqlStr ="SELECT * FROM studentTable;"; dAdapter = new OleDbDataAdapter(sqlStr,myConn); dset = new DataSet(); dAdapter.TableMappings.Add("Table","studentTable"); dAdapter.Fill(dset); DataSet.DefaultViewManager property this.dviewmanager=dset.DefaultViewManager; this.comboBox1.DataSource=this.dviewmanager; this.comboBox1.DisplayMember="studentTable.StudentID"; i want to do the same things with vc++ .net its possilbe? thanks
-
how to fill a combobox with datatadapterI want fill a combobox with a dataadapter, can i do that in vc++ and how i do that? (in vb or c# is possible!) there are some others way? i want a key and a value for all the item of the combobox. thanks a lot