|
well....if the email body is in a textbox ( i don't use outlook) you could probably use something like
MessageBox.Show(emailbodytxtbox.SelectedText);
also look into this area(may need to add a reference)
System.Net.Mail.SmtpClient
|
|
|
|
|
Hello,
Is it possible any way to override the Hosting Page's RENDER Method from a server control in ASP.NET C#.NEt 2.0 ? I am developing a server control and my intention is to modify the whole page's rendering HTML from this Control.
Please advice.
Thank you,
|
|
|
|
|
Please don't cross post. It's rude. Read the forum guidelines.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Sorry Paul, actually It was my mistake to post in this wrong section, later I found that ASP.NET section is there for this category so I posted there too.
But I did not understand why it should be rude ! I apologize for my ignorance but I am just curious about this rule. I thought, I can acquire more knowledge by getting more response from both sections from more replies by different experts, is not it acceptable ? Anyway, Sorry again for my ignorance.
|
|
|
|
|
bashiwala wrote: was my mistake to post in this wrong section
No big deal.
bashiwala wrote: I thought, I can acquire more knowledge by getting more response from both sections from more replies by different experts
Most of the people that respond in these forums respond to more than one forum, so cross posting in other forums is not really likely to change the amount of responses you may get ( other than the don't cross post responses ).
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
It's considered rude because it makes it difficult for people to collaborate on a solution if replies are being recorded in multiple forums. It also makes it harder for people searching the forums to find the definitive answer to a question. When posting a question, consider which forum is most appropriate. Most people who answer questions, including myself, look at posts in all the main forums. Cross posting won't help you get a better answer to your question, but it will p*** people off .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
Is there any way to disable the methods Equals and ReferenceEquals?
They always seem to appear by default if I create a struct or class.
Why do I want to get rid of them/hide them?
1. Because they anoy me in classes/structs that I don't need to use them in.
2. Because out of interest I want to know if you can.
Regards,
Mark.
|
|
|
|
|
No, you can't. Equals is a virtual method on System.Object, which is inherited by all types (value or reference) in .NET. ReferenceEquals is a static method, again defined in System.Object.
Your types will derive (implicitly or explicitly) from System.Object, so there's no way you can get rid of them.
|
|
|
|
|
Hi,
Can any one tell me how to change a messagebox font?
I know I have to Create my own messagebox but I don't know how?(create a form to act like message box or derive from messagebox class)
so please tell me how to change messagebox font?
|
|
|
|
|
you can create your own custome components!
|
|
|
|
|
You'll have to create your own custom message box like Abhijit suggested. Take a look around this site, there is an article or two how to achieve this.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Perhaps this[^] article may help?
/ravi
|
|
|
|
|
Hi,
I need a suggestion in handling socket communication in my project.
i am writing a diagnostic software which will run in a laptop. The laptop will be hooked upto a ring network ( 5 computers connected together in ring topology). Where i have to communicate to all the computers connected and have to send/receive diagnostic messages to all/particular computer.
I am thinking about creating multiple client socket( in diagnostic software )for all the computers connected. Each computer will run a server socket which will listen for client connection.
In this case i suppose to create 5 client socket (since 5 computers connected) and each computer will have its server socket.
Is there anyway to simplify this ie. one server socket on laptop and one client socket on each computer. In this case a client socket can't listen for server connections right?
Please suggest a better way, i want to do in TCP not in UDP
or suggest any article which will help me understand this better.
Thanks
Srini
|
|
|
|
|
I do not know much about Stream-Socket connections but I know you can create just a server on a computer then have 4 clients on each computer. Because with the server you can still talk through it (use it like a client also).
I read it in a book I was reading... it was in Deitel.com C# code examples.. you will have to register.
You will have a server that listens.
TcpListener listener;
int counter = 1;
IPAddress local = IPAddress.Parse( "127.0.0.1" );
listener = new TcpListener( local, 50000 );
listener.Start();
Then you create the clients that connects to the server
TcpClient client;
client = new TcpClient();
client.Connect( "127.0.0.1", 50000 );
Like I said.. there is more, too much to post on here. Register on the website and check it out. I don't know much, but I was reading it not too long ago.. hope this helps a little bit!
Others have helped me, so hopefully I can have my chance to help someone else
|
|
|
|
|
Hi There ,
I have an application that uses excel COM interop. (Microsoft.Office.Interop.Excel)
However , If i distribute my app to computers that for eg. do not have excel ,
The application will crash.
Is there a way to make my app behave differently in case Excel is not installed (for eg. detect the error and display a message ?)
Thanks In advance.
|
|
|
|
|
yoavyoavyoav wrote: Is there a way to make my app behave differently in case Excel is not installed (for eg. detect the error and display a message ?)
It isn't an error you get, it is an Exeption. All you need to do is catch the appropriate exception.
|
|
|
|
|
You might be able to tell your app's installer that Excel is a prerequisite.
However I suggest you find a better solution than excel COM interop.
|
|
|
|
|
Thanks for your reply.
Unfortunatly , I Do want to provide a logic for my application so If excel is installed , it will do one thing , and if not - another thing (the application is a reporting tool that generates CSV files).
The only way I found to call to Excel from within my .Net app is by using the COM interop (It's my first time using COM interops). If excel is installed it works well , but if I move my application .exe to another computer and excel is not installed on it - Bam and the application crashes when I press the button that displays excel from within my app.
I've tried protecting the code block that calls the excel interops with try-catch , but it didn't work (the exception was not caught in my " Catch(Exception ex) " for some reason.
I do need a solution for this problem so I'll appreciate any reply.
(I've seen some stuff around the web with using the COM interop with late\early binding - anyone care to explain and will it solve my problem ?)
Thanks.
|
|
|
|
|
You certainly don't need Excel to produce CSV files; in fact it's probably better not to.
Just implement the "other thing" and be done with it.
|
|
|
|
|
Thanks again for replying.
I think I'm not well understood.
My application generates CSV reports (on it's own , not related to excel) , and then , in order to view the generated file I want to provide the functionality for the app to open up excel and display the generated file.
By using excel interop function like "autofit" and such , I can make the report appear nicely. - This way the end-user can also save it to xls format if he chooses to.
My other alternative is to just call System.Diagnostics.Process.Start(OutputCSV) file and let the user deal with it.
The problem in this instance - is that if for eg. Excel is associated with the CSV files , the files won't be opened well in excel and the user will need to reopen them from within excel (So a dialog will be opened up where he can specify that the file is Comma Delimited).
Is there a way perhaps to pass an argument to the excel.exe file that says that the file is CSV ? that will be extremely useful in my case.
My Last alternative is to display the CSV file in a built in datagrid in another form - though this is less functional. (It doesn't have the "power" of an excel worksheet").
Thanks.
|
|
|
|
|
Then use Process.Start to open the file, and the operating system will look for a file association for CSV files, if it finds Excel it'll use it, if it finds some other program that the user prefers, it'll use that.
|
|
|
|
|
OK - Perhaps I will settle with that.
But regardless - if I use try-catch on the Code block that calls the Excel interops - the exception that is triggered on a computer that doesn't have excel installed is not being caught.
Why is that ? (This also happens , if for eg. the DLL the application is using is not available. is there a way to detect this and display a message to the user ?
May Something like --> CanICreateObject(objectType) ?
Thanks
modified on Monday, January 14, 2008 10:56:57 AM
|
|
|
|
|
Hi!
From my experience, a failed object creation for COM objects that are not available can be caught just like any other exception.
How do you create your Excel object? I don't have the Excel PIA (and thus the namespaces and classes it provides) at hand, but something like this should work:
Microsoft.Office.Excel._Application app = null;
try
{
app = new Microsoft.Office.Excel._Application();
}
catch
{
}
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Sorry I am back so soon. For some reason when I save my database it tries to convert the Home Phone, Cell Phone, and Fax into System.Int32. I have them set on System.String.
" Failed to convert parameter value from String to a Int32. "
I have no code in there tring to convert it. Like I said in the database the textbox is set to System.String.
When I enter like: 123455 it works
When I enter like: 123-4567 it doesn't because of the dash.
|
|
|
|
|
Your post contains some confusing terminology so I am not sure what you mean by certain things.
Jacob Dixon wrote: For some reason when I save my database it tries to convert the Home Phone, Cell Phone, and Fax into System.Int32. I have them set on System.String.
By "save" did you mean "INSERT" or "UPDATE"?
Jacob Dixon wrote: Like I said in the database the textbox is set to System.String
The database knows nothing about textboxes. Nor does it use System.String. It uses char, varchar, nchar and nvarchar.
Could you post the relevant code? Both C# and SQL.
|
|
|
|