Re: [MSH] how to list constuctor overloads
- From: "Jeff Jones [MSFT]" <jeffjon@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Nov 2005 08:40:54 -0800
MSH >[System.Net.Mail.Attachment].GetConstructors() | foreach-object {
$_.ToString() }
Void .ctor(System.String)
Void .ctor(System.String, System.String)
Void .ctor(System.String, System.Net.Mime.ContentType)
Void .ctor(System.IO.Stream, System.String)
Void .ctor(System.IO.Stream, System.String, System.String)
Void .ctor(System.IO.Stream, System.Net.Mime.ContentType)
--
Jeff Jones [MSFT]
Microsoft Command Shell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"/\/\o\/\/" <no@xxxxxxxx> wrote in message
news:emgS8rk6FHA.1276@xxxxxxxxxxxxxxxxxxxxxxx
> how to get the constructors of a .net Object in MSH
>
> as I did a blogentry about sending mail in MSH, i came to this little
> problem as I got a Q of a reader onhowto send an attachement, :
> (I did it already but not without looking in the SDK for the constructor
> overloads)
>
> the golden trick of JS to find the Add Method (Watch the Comma !)
>
> MSH>,$msg.get_Attachments() | gm
>
>
> TypeName: System.Net.Mail.AttachmentCollection
> Name MemberType Definition
> ---- ---------- ----------
> Add Method System.Void Add(Attachment item)
> ......
>
> I did know that I needed an attachement object first (fits nice in the
> topic using .net objects as parameters b.t.w. ;-)
>
> but now :
>
> MSH>$att = new-object System.Net.Mail.Attachment
> new-object : Constructor not found. Cannot find an appropriate constructor
> for type System.Net.Mail.Attachment.
> At line:1 char:18
> + $att = new-object <<<< System.Net.Mail.Attachment
>
> how can I get the valid constructors ?
>
> I tricked it a bit with this :
>
> MSH>[System.Net.Mail.Attachment] | gm -static | fl
>
> TypeName : System.Net.Mail.Attachment
> Name : CreateAttachmentFromString
> MemberType : Method
> Definition : static System.Net.Mail.Attachment
> CreateAttachmentFromString(String content, String name), static
> System.Net.Mail.Attachment C
> reateAttachmentFromString(String content, String name,
> Encoding contentEncoding, String mediaType), static System.Net.Mail.Att
> achment CreateAttachmentFromString(String content,
> ContentType contentType)
>
> But its not the same as this one is missing :
>
> Attachment (String) Initializes a new instance of the Attachment class
> with the specified content string.
>
> so the question is can I get the constructor overloads from MSH ?
>
> gr /\/\o\/\/
>
> the mailing sample can be found here :
> http://mow001.blogspot.com/2005/11/sending-mail-from-msh.html
.
- Follow-Ups:
- Re: [MSH] how to list constuctor overloads
- From: Keith Hill
- Re: [MSH] how to list constuctor overloads
- From: /\\/\\o\\/\\/
- Re: [MSH] how to list constuctor overloads
- References:
- [MSH] how to list constuctor overloads
- From: /\\/\\o\\/\\/
- [MSH] how to list constuctor overloads
- Prev by Date: Re: [MSH] ! vs -not
- Next by Date: Re: how do i select a substring in "select-object"
- Previous by thread: [MSH] how to list constuctor overloads
- Next by thread: Re: [MSH] how to list constuctor overloads
- Index(es):
Relevant Pages
|