|
I am in the same trouble,have you solved it ? if you have solved it ,can you tell me the way? thank you and my email is shineqiujuan@163.com
|
|
|
|
|
Hi,
How i can send mail to more that one person,
i've looked all over the internet and find only the option to add the Bcc (Blind carbon-copy).
Is there any other option to do so, like at the "TO"?
Thanks,
Tamir
|
|
|
|
|
treuveni wrote: i've looked all over the internet and find only the option to add the Bcc (Blind carbon-copy).
Is there any other option to do so, like at the "TO"?
The 'to' in some mail programs, just adds to the CC, which is like the BCC, except everyone can see who you mailed to.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
when using the MailMessage class, the properties To, Cc, and Bcc are MailAddressCollections.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Forgive me if this is too obvious, but have you tried simply semi-colon seperating the addresses you want to send to?
I.e, if you want to send an email to three people the string passed into the "TO" field would be something like "john@something.com ; bill@something.com ; ted@something.com".
Is that what you mean?
|
|
|
|
|
Ofcource...
and i received this error:
The specified string is not in the form required for an e-mail address
|
|
|
|
|
I run a c# application which returns results in the format of the following text:
Is this example below, I would like to return the text "SizeStoredInPagingFiles: 4476456"
I always need to get the last text such as the above in this sample.
"Microsoft (R) Windows Script Host Version 5.6\r\nCopyright (C) Microsoft Corporation 1996-2001. All rights reserved.\r\n\r\n-----------------------------------\r\nWin32_OperatingSystem instance\r\n-----------------------------------\r\nSizeStoredInPagingFiles: 4476456\r\n"
"Microsoft (R) Windows Script Host Version 5.6\r\nCopyright (C) Microsoft Corporation 1996-2001. All rights reserved.\r\n\r\n-----------------------------------\r\nWin32_OperatingSystem instance\r\n-----------------------------------\r\nversiontext : 2\r\n"
In the above sample I would like to return "versiontext : 2"
How do I do this please?
|
|
|
|
|
Use the substring function
himanshu
|
|
|
|
|
use Environment.NewLine to get your \r\n, and use the split method.
string[] parts = myString.Split(Environment.NewLine);
will give you an array of strings. Assuming each part you want is a full line of text, you'll have them seperated as you need. If not, use regex.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
Hi,
First time I am using datagridview I have some questions and problems.
Please guide me or provide solutions if possible.
I am using adapter to bind the DGV.
1. My datasource is coming through multiple tables
Exe: select a,b,c,d from t1 left outer join t2 on t1.a=t2.d
Because of that any kind of modification update, delete, insert not working
2. unable to add auto row columns
3. unable to find cells textbox property, I want to use cells textbox autocomplete property for providing help to users
<pre> private void dgCountryZone_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dgCountryZone.Columns[this.dgCountryZone.CurrentCell.ColumnIndex].Name.Equals("Destination Code"))
{
TextBox txt = e.Control as TextBox;
txt.Multiline = false;
txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
txt.AutoCompleteSource = AutoCompleteSource.CustomSource;
txt.AutoCompleteCustomSource = colCountryListCodeCheck;
}
}
4. in the time of validation if I am using cells current position its not work
exe: say present cell position is cell(4,5) now user press tab if validate pass then I want to set focus on cell(4,9) or else in cell(4,5) but it moves on cell(4,10) or cell(4,6)
<pre>private void dgCountryZone_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
Int32 RowCounter;
Int32 DuplicateCounter;
IDataReader idrCountryName;
DuplicateCounter = 0;
if (dgCountryZone.Columns[e.ColumnIndex].Name == "Destination Code")
{
if (Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) != "")
{
for (RowCounter = 0; RowCounter <= dgCountryZone.Rows.Count - 1; RowCounter++)
{
if (Convert.ToString(dgCountryZone.Rows[RowCounter].Cells[e.ColumnIndex].Value) == Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value))
{
DuplicateCounter++;
}
}
if (DuplicateCounter > 1)
{
dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "";
MessageBox.Show(MessageResource.DuplicateRecord, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgCountryZone.CurrentCell = dgCountryZone[e.ColumnIndex, e.RowIndex];
return;
}
else
{
DataAccessLayer daobj = new DataAccessLayer();
UserDataType.CountryParam CParam = new UserDataType.CountryParam();
CParam.szCountryCode = Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value);
dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value = "";
idrCountryName = daobj.GetHelpCountryName(CParam);
while (idrCountryName.Read())
dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value = idrCountryName.GetString(0);
if (Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value) != "")
{
dgCountryZone.CurrentCell = dgCountryZone[e.ColumnIndex + 1, e.RowIndex];
return;
}
else
{
MessageBox.Show(MessageResource.CodeNotFound, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgCountryZone.CurrentCell = dgCountryZone[e.ColumnIndex, e.RowIndex];
return;
}
}
}
else
{
MessageBox.Show(MessageResource.BlankField, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgCountryZone.CurrentCell = dgCountryZone[e.ColumnIndex, e.RowIndex];
return;
}
}
if (dgCountryZone.Columns[e.ColumnIndex].Name == "Per CWB/KG")
{
if (Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) != "")
{
if (Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value).ToUpper() != "K" && Convert.ToString(dgCountryZone.Rows[e.RowIndex].Cells[e.ColumnIndex].Value).ToUpper() != "W")
{
MessageBox.Show("Please select [W for per CWB] and [K for KG]", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgCountryZone.CurrentCell = dgCountryZone[e.ColumnIndex, e.RowIndex];
return;
}
}
else
{
MessageBox.Show(MessageResource.BlankField, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgCountryZone.CurrentCell = dgCountryZone[e.ColumnIndex, e.RowIndex];
return;
}
}
}
Please suggest if I am wrong or any code help if possible
Regards
Prakash
Prakash
|
|
|
|
|
Hi,
I'd created a Custom Control using MaskedTextBox and DateTimePicker. I'd written all the required validations and it is working fine. I'd even created a CustomEventHandler by using Delegate. The Problem is when I drag this control on to a form I could not find the CustomEventHandler to raise. Here is my Code. Can anyone suggest the solution. Thanks in Advance
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace DateControl
{
public partial class UserDateControl : UserControl
{
private bool IsTrue;
private bool Err;
private string MskText;
public delegate void DateControlEventHandler();
[Category("Action"),Description("Fires when the Text Changed event Occurs!")]
public event DateControlEventHandler TextChanged;
public UserDateControl()
{
InitializeComponent();
}
protected virtual void OnTextChanged()
{
if (TextChanged != null)
{
TextChanged();
}
}
private void DTPicker_ValueChanged(object sender, EventArgs e)
{
string DTP;
if (DTPicker.Value.Day < 10)
DTP = "0" + DTPicker.Value.Day + "-";
else
DTP = DTPicker.Value.Day + "-";
if (DTPicker.Value.Month < 10)
DTP += "0" + DTPicker.Value.Month + "-";
else
DTP += DTPicker.Value.Month + "-";
DTP += DTPicker.Value.Year;
MskDateControl.Text = DTP;
}
[Category("DateControl Configuration"),Description("Whether the Control should accept more than Today's date?"),DefaultValue(false)]
public bool AcceptMoreThanToday
{
get { return IsTrue; }
set
{
IsTrue = value;
}
}
public string DateValue
{
get { return MskText; }
set
{
MskText = MskDateControl.Text;
}
}
private void MskDateControl_Validating(object sender, CancelEventArgs e)
{
if (MskDateControl.MaskFull == false)
{
errorProvider1.SetError(MskDateControl, "Please Check the Date!");
}
}
private void MskDateControl_TextChanged(object sender, EventArgs e)
{
if (MskDateControl.MaskFull == true)
{
Char[] ChrSep = new Char[] { '-' };
String[] SplitDate;
SplitDate = MskDateControl.Text.Split(ChrSep, 3);
int y = int.Parse(SplitDate.GetValue(2).ToString());
int d = int.Parse(SplitDate.GetValue(0).ToString());
int m = int.Parse(SplitDate.GetValue(1).ToString());
Err = false;
if (m > 12 || m <= 0)
{
Err = true;
errorProvider1.SetError(MskDateControl, "Please Check the Month!");
}
else if (y < 1900)
{
Err = true;
errorProvider1.SetError(MskDateControl, "Please Check the Year!");
}
else if (DateTime.DaysInMonth(y, m) < d)
{
Err = true;
errorProvider1.SetError(MskDateControl, "Please Check the Days!");
}
else if (d > 31 || d <= 0)
{
Err = true;
errorProvider1.SetError(MskDateControl, "Please Check the Days!");
}
else
{
Err = false;
errorProvider1.SetError(MskDateControl, "");
if (TextChanged != null)
{
OnTextChanged();
}
}
if (IsTrue == false && Err==false)
{
DateTime CnvDate = new DateTime(y, m, d);
DateTime SDate = DateTime.Today;
if (CnvDate > SDate)
{
errorProvider1.SetError(MskDateControl, "Date should not be more than Today's Date");
}
}
}
}
private void MskDateControl_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == ' ') e.KeyChar = (char)0;
}
private void MskDateControl_Validated(object sender, EventArgs e)
{
if (Err == false && MskDateControl.MaskFull == true)
{
Char[] ChrSep = new Char[] { '-' };
String[] SplitDate;
SplitDate = MskDateControl.Text.Split(ChrSep, 3);
int y = int.Parse(SplitDate.GetValue(2).ToString());
int d = int.Parse(SplitDate.GetValue(0).ToString());
int m = int.Parse(SplitDate.GetValue(1).ToString());
DateTime EDate = new DateTime(y, m, d);
DTPicker.Value = EDate;
DateValue = MskDateControl.Text;
}
}
}
}
Sreedhar Kadiyala
|
|
|
|
|
It appears that MS has done some fancy hiding on the original TextChanged event for a UserControl.
Firstly, you should mark the event as new so it replaces the inherited implementation then add the following two attributes to it:
[EditorBrowsable(EditorBrowsableState.Always),
Browsable(true)]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thank you very much. It worked.
Sreedhar Kadiyala
|
|
|
|
|
i need to write the codeing for QR barcode decoder. i found few sample codings but thats quite complecated....is there any easy way than this? simple way to decode a QR barcode.
Open Source QRCode Library[^]
|
|
|
|
|
S K Y wrote: need to write the codeing for QR barcode decoder. i found few sample codings but thats quite complecated....is there any easy way than this? simple way to decode a QR barcode.
Open Source QRCode Library[^]
...simpler than this? You are probably a bit lazy.
Regards: Didi Kunz
|
|
|
|
|
I have a web application and a console application. I used datetime in both the application. However I need to set the culture of the datetime by the culture of that local. I have configured the application in Itely server, it'w works fine there, however when I configured in India it shows the datetime error.
Pankaj
|
|
|
|
|
And the error looks like? Do you get an error message?
|
|
|
|
|
How can we help if you don't tell us what the error is? Posting the relevant code sample also helps.
Cheers,
Vikram. Recent activities:
TV series: Friends, season 8
Books: Freakonomics, by Steven Levitt and Stephen J Dubner. Carpe Diem.
|
|
|
|
|
I want retrieve tagelements of a html details using c#.
In the html page, if I get
<Label class="splAlink" onMouseOver="hover2(this)" onMouseOut="visited2(this)" onClick="openFile('/20095/PC_COLLECTIONRECEIPT_205092.pdf')" >PC_COLLECTIONRECEIPT_205092</Label>
mshtml.HTMLLabelElement labelElem = (mshtml.HTMLLabelElement)htmlElement; // where htmlElement.outerHTML gives above text
labelElem.onclick gives a object value.
From this object variable how can i get the string "openFile('/20095/PC_COLLECTIONRECEIPT_205092.pdf')"
|
|
|
|
|
Well, did you try to use ToString()? Try to debug your app, set a breakpoint where you access labelElem.onclick and see what type the object is.
Regards
Sebastian
|
|
|
|
|
can any one tell me the tag? i'm a new learner...Please give me code sample..
|
|
|
|
|
The Tag property is of type Object, so you can put anything in there that you like, you'll just need to cast it to the correct type when you want to retrieve it.
For example, If you were making a view of People, you may just be displaying the Surname in each node but you could put the entire Person object in the Tag, so when the node is selected, you can cast the selected node's Tag to Person and retrieve the whole object back again.
BTW, nearly every control has a Tag property, not just a Node.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I'm really happy and thank you....
Now i know it clearly..
|
|
|
|
|
This is bizarre!
I've got an app in C# that uses DirectSound. I set up the SecondaryBuffer in the normal way, using a WaveFormat struct. It runs fine on my machine and on other machines that have downloaded and installed the latest version of DirectX (DirectX 9.0c (4.09.0000.0904)).
However, on machines that show the exact same DirectX version number, when I run the program, if there is so much as a declaration that there is the slightest chance that I might possibly be considering using a WaveFormat structure, I get a file not found dialog box which tells me there was a "system.io.filenotfoundexception". Nothing in the detailed error report tells me what file was not found.
If I download and install the latest DirectX install, everything is fine. If I UNINSTALL DirectX from the machine, the program STILL WORKS!!! I've been comparing installed DLLs, looking for something that might account for the problem, but so far no luck.
I'm gonna get some pushback from my client if I tell him that all of his customers have to download and install the latest DirectX even if they already think they have it installed. Heck, I'd be pretty annoyed if somebody told me that! But, so far, that's the only solution I've found. I hope somebody else has run into this, or has an idea about tracking down the missing file.
In case it's not clear, all I have to do is have the following line in my code, and the program will not run on a computer that has not had DX re-downloaded and installed:
WaveFormat wFormat;
That's all it takes. And, as I'm sure many of you know, the WaveFormat structure has been around since before the last ice age, it's not something new.
|
|
|
|
|