|
how do i use the Activator.CreateInstance on the type?
thanks
|
|
|
|
|
Have you tried the documentation?
|
|
|
|
|
Hi,
In my Bin's Release folder (C# Windows project .NET 2.0), I see two identical files have been created,
1] MyProjectName.exe.config
2] MyProjectName.vshost.exe.config
I understood that, MyProjectName.exe.config is the output version of App.Config file, but what is MyProjectName.vshost.exe.config and why is that required ? If I dont ship that file to my user's computer, will there be any problem for running the software properly ?
|
|
|
|
|
|
Thanks a lot. I got my answer
|
|
|
|
|
Well a quick search on google brought me this:
By default every time you compile a WindowsApplication or ConsoleApplication project using VS2005, a "vshost.exe" and a "vshost.exe.config" files are created on the \Bin\Debug and \Bin\Release paths.<br />
<br />
The purpose of these "vshost.exe" and a "vshost.exe.config" files is described <a href="http://msdn2.microsoft.com/en-us/library/ms242202(VS.80).aspx">here</a>[<a href="http://msdn2.microsoft.com/en-us/library/ms242202(VS.80).aspx" target="_blank" title="New Window">^</a>].<br />
<br />
To disable this feature you need to:<br />
<br />
Open a project in Visual Studio. <br />
On the Project menu, click Properties. <br />
Go to the Debug Tab <br />
Clear the Enable the Visual Studio hosting process check box.<br />
<br />
Another common question is if we need to deploy these files and the answer is No, the "*.vshost.exe" and "*.vshost.exe.config" files are only for use in the Visual Studio 2005 IDE<br />
<br />
Pablo
Short answer? no you don't need to ship this out with the app, at least im pretty sure anyways...
Damn, beaten to it... ah well
|
|
|
|
|
|
try
{
System.Web.Mail.MailMessage message=new System.Web.Mail.MailMessage();
message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","10");
message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername","SmtpHostUserName" );
message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword","SmtpHostPassword" );
message.From="mymail@hotmail.com";
message.To="anymail@hotmail.com";
message.Subject="hi";
message.Body="worked";
System.Web.Mail.SmtpMail.SmtpServer="SMTP Server Address";
System.Web.Mail.SmtpMail.Send(message);
}
catch(Exception ex)
{
Response.Write(ex.Message.ToString());
}
-what is SmtpHostUserName and SmtpHostPassword and how can i get "SMTP Server Address"?
-the "10" iis Default SMTP Virtual Server propertis take the number right?
-some thing missing here can any one help
thank you
Mohsen
-- modified at 22:28 Thursday 19th October, 2006
|
|
|
|
|
Ah_Mohsen_aly wrote: what is SmtpHostUserName and SmtpHostPassword
The username and password for the mail account in question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi guys,
This activex control has optionals parameters for GetData method:
this.axWinsock1.GetData(ref object data,object type,object maxlen)
i tried these:
object rec= string.Empty;
object type = 0;
object maxlen = 0;
this.winsock.GetData(ref rec, type, maxlen);
or
object rec= string.Empty;
object type = string.Empty;
object maxlen = string.Empty;
this.winsock.GetData(ref rec, type, maxlen);
but all i get is "Unsupported variant types" error message, do you know how to call this getdata method in c#? i know if you call it in vb.net you dont need to pas optional parameteres.
Please help
|
|
|
|
|
You might be able to pass a null value as the optional parameter. Alternatively you might want to look at the System.Net.Sockets class of the framework which does essentially the same thing except that it's more powerful and it's the proper .NET way of reading and writing data across Sockets.
Sig cops got me...
|
|
|
|
|
Null is not working, im done with this if i just know what to send for this.
|
|
|
|
|
I would take a look through the documentation and try and find out what it expects or what the values default to if not supplied.
In VB there's usually a default setting provided for the optional parameters, try using that.
Sig cops got me...
|
|
|
|
|
I've looked in some CP articles and in my MSDN library, but can't find the answer to my question...
How do I hide a public member of a base class? I'm trying to inherit from the TrackBar class, and I want to make the public members Value and Maximum inaccessible (make them private members instead of public). I've tried just saying:
private new int Value;
and
private new int Maximum;
in my inheriting class, but, elsewhere in the code, when I have:
myTrackBar.Maximum [...]
it doesn't give me a compile error like I want.
So...
How do I, like, convert the public members Value and Maximum into private members?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
You totally cannot change your base class. You could make an intermediate class, which makes those properties private to THAT class, and do your real work in a class derived from that, but what a tangled web you want to weave. Why do you want to make things private to a class you don't have access to ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm trying to make a visually reversed trackbar.
For example, pretend the trackbar's value is 100 (out of 300). The public member "rValue" would tell you that the value is actually 200 (meaning Maximum - (Value - Minimum) ). And, if the user set "rMaximum" to a certain value, it would adjust the Value accordingly (to keep it the same amount below Maximum, not the same amount above Minimum).
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
OK. Well, why not override the Value method instead and have it track in reverse ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Two responses...
1) Value is a method? I thought it was just an int member... I suppose it would be most efficient to make it one of those funky methods that look like members to outsiders, so that whenever it was changed the little tick thing would move...
2) If I try to override it, I can just call ((TrackBar)base).Value from inside my class, right?
I'll give it a shot, thanks!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
1 - OK, I mixed my terminology. I doubt it's an int. I meant it's a property.
2 - Yes, if you use new and not override, I'd expect you can do that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Well, this is what I tried (code below). However, the compiler says "Use of keyword 'base' is not valid in this context ". I thought that base was like this , but for accessing a parent class. How should I do it?
public class ReverseTrackBar : TrackBar
{
private new int Value
{
get { return (((TrackBar)base).Maximum - (((TrackBar)base).Value - this.Minimum)); }
set { ((TrackBar)base).Value = (((TrackBar)base).Maximum - ((int)value - this.Minimum)); }
}
private new int Maximum
{
get { return ((TrackBar)base).Maximum; }
set
{
int val = this.Value;
((TrackBar)base).Maximum = (int)value;
this.Value = val;
}
}
public ReverseTrackBar()
{
this.Value = 0;
}
}
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I guess the 'new' keyword is hiding the base value.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
No, that's not it. See the message I posted at the same time as you...
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Oh, I guess you don't have to cast base to a type because the type is already known (the type I'm inheriting from).
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Yes, I wondered about that
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Heritos Gger wrote: However, the compiler says "Use of keyword 'base' is not valid in this context".
The error is not related to the use of the keyword 'base', but to the fact that you try to cast the base to type TrackBar. You don't need to do that. Remove all of these casts (e.g. ((TrackBar)base).Value should be base.Value) and the compiler error will disappear.
|
|
|
|