|
Hi,
and did you already tried to do this by reflection? Did you get an error or exception?
Regards
Sebastian
|
|
|
|
|
I am new to c#.
I am looking for a code snippet that will help me out.
Regards,
Ankit
|
|
|
|
|
So did I get you right, you want to create a stream outside of SmtpClient and authenticate the stream with the private method of SmtpClient? So does the method signature accepts a stream? If yes, it could propably work, if not then you have to use the SmtpClient class or authenticate by your own.
Could you provide the method signature so that it is possible to write some code around...
Regards
Sebastian
|
|
|
|
|
You got me right there..
But I am afraid I don't know if any such method exists...
Regards,
Ankit
|
|
|
|
|
To check if such a method exists you could use a reflector, like .NET reflector...
http://www.red-gate.com/products/reflector/[^]
Locate the SmtpClient-class within System.dll and check the existing methods. But the best way would be either implementing the authentication by yourself or using the SmtpClient-class.
Regards
Sebastian
|
|
|
|
|
Thanks,
I already tried reflector without luck.
And i have managed to code an authentication mechanism usign "Auth login" command.
But there might be other set of authentication command which i dont know.So i am just worried.
Thanks for the quick replies anyway.
Regards,
Ankit
|
|
|
|
|
|
Thanks again,
I just ran reflector again on the system.net.mail dll and found out a AuthCommand class and one smtpauthenticaiton module class.
Any code snippet will still be helpful.
Regards,
Ankit
|
|
|
|
|
i have listview with mutltiple column...nw i want to iterate only items of first column.hw can this be done?
|
|
|
|
|
string s=@"c:\d\e\wwww";
s.lastindexof('\').tostring();
it will show you only wwww
for you you should put:
string ss=s.substring(0,s.lastindexof('\t'));
|
|
|
|
|
Each row in a listview is represented by a ListViewItem which contains the content of the first column. The other columns are stored in ListViewSubItem s in the SubItems collection of ListViewItem.
So something like:
foreach(ListViewItem item in listview1.Items)
{
}
Regards,
Rob Philpott.
|
|
|
|
|
hi
i m inserting some vlues into a listbox but now i want to
restrict the duplication of entries in the list box
private void lblpush_Click(object sender, EventArgs e)
{
for (int i = 0; i < tbxnumber.Text.Length - 1; i++)
{
if (list1.Items[i] == tbxnumber.Text[i]) return;
object list = tbxnumber.Text[i];
list1.Items.Add(list);
}
}
but it does not work
|
|
|
|
|
Here you go
private void InsertListBoxItem(string NewItem)
{
if (!listBox1.Items.Contains(NewItem))
{
listBox1.Items.Add(NewItem);
}
}
Hope it helps
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
No, it won't.
Problems:
1) You are looping round exactly as many times as there are characters in the textbox, rather than the number of times there are items in the list.
2) You are comparing the list item with a single character.
Try:
1) using the codeblock widget to preserve your formatting when you post code fragments - it make it easier to read, and thus understand.
2) using foreach(ListBoxItem lbi in list1) instead of a for loop.
3) using ListBox.Contains instead of the loop at all!
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
Hi, I'm using a checkedList control to specify what should be disabled from the menu strip items, it works fine and the object gets disabled but apparently it's nothing but a copy of the control, how can I access it directly instead of dealing with a copy of it?? Here's what I'm using for the top level menu items
foreach (ToolStripMenuItem mi in _Form1.menuStrip.Items)
foreach (string cb in chlstMenuItems.CheckedItems)
if (mi.Text.Replace("&", String.Empty) == cb)
mi.Enabled = false;
|
|
|
|
|
I'm not sure what problem you are having - there is no copying going on, so what make you think you are dealing with a copy?
I would also be tempted to use the Tag field of the checklist to refer directly to the ToolStripMenuItem it enables / disables rather than loop round each time I want to enable / disable it via the text string.
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
Hey Griff,
Thank you for your time.. and please, tell me about this "Tag" thing.
|
|
|
|
|
My apologies! CheckedListBoxItem uses strings rather than an object derived from ListViewItem (unusually), and so there is no Tag to use.
So, why do you think it is a copy?
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
OriginalGriff wrote: CheckedListBoxItem uses strings rather than an object derived from ListViewItem
That's where I thought I was missing something but it's okay.
OriginalGriff wrote: So, why do you think it is a copy?
Simply because nothing happens when I set their Enable property to true
|
|
|
|
|
Wait, it works like a charm when calling it from the very same form but I'm trying to access it through an object from the class and these controls are not static
Forget about it, I'm calling it from the same form now and that's what I was going to do eventually
|
|
|
|
|
how to set crystal report textobject value in runtime??
|
|
|
|
|
hello every body
i want to get the file list one by one in a lable giving path of the folder of the file using this code but it does not work
for (int i = 0; i < Directory.GetFiles(textBox1.Text).Length - 1; i++)
{
object[] file=Directory.GetFiles(textBox1.Text+@"\");
label2.Text = file[i].ToString();
}
can any body
explain me
|
|
|
|
|
as i understand
you want to write all dir. in label, try this:
for (int i = 0; i < Directory.GetFiles(textBox1.Text).Length - 1; i++)
{
object[] file=Directory.GetFiles(textBox1.Text+@"\");
label2.Text += file[i].ToString()+"\n";
}
or
arraylist a=new arraylist();
for (int i = 0; i < Directory.GetFiles(textBox1.Text).Length - 1; i++)
{
object[] file=Directory.GetFiles(textBox1.Text+@"\");
//label2.Text += file[i].ToString()+"\n";
a.add(file[i].ToString());
}
|
|
|
|
|
thanks sir
but exactly what i need is
the files name
of the dir. is just kike the anti virus file scane
looks
that is file name
and the path is showing in the lable might be using timerin it
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
timer1.Interval = 2000;
}
private void timer1_Tick(object sender, EventArgs e)
{
for (int i = 0; i < Directory.GetFiles(textBox1.Text).Length - 1; i++)
{
object[] file=Directory.GetFiles(textBox1.Text+@"\");
label2.Text = file[i].ToString();
}
timer1.Stop();
}
whatis the problem in it
this shows only the last file of the dir.
|
|
|
|
|
sorry are you trying to make anti virus program
|
|
|
|