|
Thank for the replies. And How can I know whether Smtp server allows that? If I want to check whether the sending is successful, is putting try catch with catch(Exception ex) enough?
|
|
|
|
|
Most don't any more. For instance, AT&T changed their servers a few weeks ago to disallow the practice.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Those mail are send via SMTP. if you want to send mail from your accout then you have to set the NetworkCredential For that. which contain your name, password and domain
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Thank everyone for helps
|
|
|
|
|
Hi, I'm using the PrintPreviewDialog class to print a PrintDocument object. I'm wondering how to bring up a print options dialog after the print button on the preview screen is hit.
Can't seem to find a way to "get in between" the PrintPreviewDialog's print button and the actual printing.
|
|
|
|
|
Hi,
printing is a complex matter if you ask me, I got the things working that I needed
but had to fight a lot to get some of the details right.
AFAIK the printer selection should occur before you go to print preview; print preview
should show things exactly as the printer will print them, so IMO it needs to know the
printer characteristics.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I am developing a add-in and I've planned to write an article about it, but I am facing VERY annoying problem that I can't figure out.
I've loaded up virtual machine to test a real time behavior of the add-in and notice this problem.
When I am run add-in (F5) from it's project, context menu items adds to the menu of the code window and aspx context CommandBars.
After I build a setup (containing .dll, .addin file and adding proper value in registry) and opening a project, add-ins main window loads, but context menus don't.
I have two folders in the installation folder.
One is for VS 2005 and other for VS 2008.
First time, I was testing with only one folder (for VS 2005) and context menu items was working.
Further on, I've added second folder to the setup project, build it and send to to virtual machine for testing.
Context menus didn't show up.
Ever since then I was unable to get them work.
I also though that setup is building with wrong .dll, but I am pretty sure that's not the case.
To exclude that possibility, I've manually added .dll file to the install folder.
Add-ins main window works on both Visual Studios.
Please help!
This is driving me crazy!!!
And sorry if I was confusing...
|
|
|
|
|
Hi,
I must be missing something very basic so please excuse the seemingly simplicity of this question:
Question: How does one create an array of classes in C# without having to call the constructor for each elment in the array.
Example: In C++ one would do the following:
<br />
class MyClass<br />
{<br />
public:<br />
int myData;<br />
<br />
MyClass::MyClass()<br />
{<br />
myData= 1;<br />
}<br />
};<br />
In main:
void main()<br />
{<br />
<br />
MyClass myVar[12];<br />
<br />
cout << myVar[0].myData;
}<br />
For C# I try this (ignore any syntax errors that may exists):
<br />
void Main()<br />
{<br />
<br />
MyClass[] myVar = new MyClass[12];<br />
<br />
Console.WriteLine("{0}", myVar[0].myData);
<br />
}
Can this be done in C#, if so, how?
-Joe
|
|
|
|
|
Hi Joe,
in C# you can not; you need to create the array as in your statement
MyClass[] myVar = new MyClass[12];
but this gives 12 null references.
Now you may or may not load the array with an explicit loop containing myVar[i]=new MyClass();
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
That's because you are not doing the same thing in the C++ code as in the C# code. A class in C++ is not the same as in C#.
In the C++ code you are declaring an array of value types. The equivalent in C# would be to use a struct instead of a class.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: The equivalent in C# would be to use a struct instead of a class.
Even then, he'd have to write additional code to initialize the data members. The best overall solution is to use a generic list
using System.Collections.Generics;
namespace MyApp
{
class Program1
{
public class MyClass
{
private int m_data = -1;
public int Data
{
get { return m_data; }
set { m_data = value; }
}
public MyClass()
{
m_data = -1;
}
public MyClass(int data)
{
m_data = data;
}
}
static void Main(string[] args)
{
List<myclass> myClasses = new List<myclass>();
for (int i = 0; i < 12; i++)
{
MyClass myClass = new MyClass();
myClasses.Add(myClass);
}
}
}
}
</myclass></myclass>
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Even then, he'd have to write additional code to initialize the data members.
That's true. In .NET there isn't any automatic construction going on without specifically asking for it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa,
You were so right on about taking the structs approach, that got me exactly what I needed.
Thanks!!!
|
|
|
|
|
Be ware, though, that structs are a bit trickier than classes. You should read a bit on the recommendations on structure implementation:
MSDN: Structs[^]
MSDN: Value Type Usage Guidelines[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a spread sheet of addresses that are in different formats.
Some of the addresses include cities or zip codes or floors or units, the formats for floor is "flr" or "floors" or "flrs"...I think you can see what I am getting at.
Is there a good parser library out there for use?
shwaguy
|
|
|
|
|
shwaguy wrote: Some of the addresses include cities or zip codes or floors or units, the formats for floor is "flr" or "floors" or "flrs"...I think you can see what I am getting at.
Not really.
If you need to match patterns in text, Regular Expressions[^] are your best bet.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
OK....I am familiar on the regular expressions thing.
I am looking for a library that already has done this.
What does Google do? Does it use a database?
shwaguy
|
|
|
|
|
on pressing button in Form 1, it opens FORM2 and hide itself. But the problem is the FORM2 pops up in different location of the screen..and when i exit that, FORM1 pops up but thats in different location.Whereas i want this to be at the same location. Just looked over properties to set the location but even when i set the same location on both the forms, it results in poping up at different place.
What can be the reason for this ? I am sure its one of the easiest thing to do but sometime that gives you heading too...
Thanks
|
|
|
|
|
Hi,
setting Form.Location only works the way you want if you first set
Form.StartPosition=FormStartPosition.Manual;
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi!
I have three tables created in SQL Server:
Tabe for Ingredients:
Ingredients
CodIng (INT) Primary Key
Descrip
Cost
Table for Recipes:
Recipes
CodRec (INT) Primary Key
Descrip
Table to specify the Ingredients that a recipe has:
RecipesIngredients
CodRec (INT)
CodIng (INT)
Quantity
I want to show RecipesIngredients for a given CodRec in a datagridview and modify it (for example add, remove or modify ingredients in a recipe) but I also want to show the description for them.
I mean I want to show in the datagridview FOR A GIVEN RECIPE (not for every recipe) these columns:
CodRec, Descrip (Recipe), CodIng, Descrip (Ingredient), Quantity
Which is the best way to do this?
Thank you!
|
|
|
|
|
hi
write a SQL query using joins in SQLdataAdapter.Using this adapter fill a datatable and bind this table to datagridview. The query will be like,
"select RI.CodRec,REC.Descrip,RI.CodIng,ING.Descrip,RI.Quantity from RI as RecipesIngredients,REC as Receipe,ING as Ingredient where RI.CodRec='receipe code' AND RI.CodIng=ING.CodIng AND ..."
This query may not give the result u want,but u have to use joins like this to get the desired result.
|
|
|
|
|
Ok, I knew how to show it.
The probem is that I will not be able to modify, insert or update the ingredients for a given receipe with that table binded to my datagridview...
Or is it possible?
|
|
|
|
|
Hi!
I am trying to write and application which will capture moving object from video camera and then move the cursor.
I will appriciate any help and guidence..
Thank you!
=Mani=
|
|
|
|
|
There's a commercial library called TVideoGrabber that offers this. If you need to write it yourself, you need to write a DX filter so you can examine your frames and look for movement.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey folks, I think this is my first time asking a question here, so please go easy on me
I have an application wherein I render a transparent bitmap (to be specific -- a chart with a transparent background).... When I do, I then try to copy it to the clipboard using:
<br />
bmp.Save(filename);
Clipboard.SetImage(bmp);
Now if I open Excel, and click Paste (from the clipboard), I end up with a copy of my chart with this lovely blue background wherever the transparency color was.
If I, instead, use Excel's Insert->Image->From File, the chart's transparency is preserved... (same bitmap as above, just one is saved to file system, the other is copied via clipboard)
What gives? Am I copying the bitmap incorrectly, or is there something else I need to do to make copy and paste of transparent bitmaps a reality?
(I have searched high and low, and nothing seems to answer this question... I have tried all kinds of things to resolve this on my own, even using MakeTransparent() (which has no effect, since the bitmap was already transparent to begin with (as evidenced by the Flags value on the bitmap being "2" which is hasTransparency)... I have tried converting the image, using color maps, using SetClipboardDataObject, converting to an HBITMAP object or whatever.... all kinds of things, nothing seems to avert this issue....)
Thanks in Advance!
=============================
I'm a developer, he's a developer, she's a developer, Wouldn'tcha like to be a developer too?
|
|
|
|