![]() |
Модераторы: Partizan, gambit |
![]() ![]() ![]() |
|
pirojok |
|
||||
![]() Новичок Профиль Группа: Участник Сообщений: 34 Регистрация: 11.11.2007 Репутация: нет Всего: нет |
Привет всем.
Есть задача переписать скрипт Си# на Powerhell. Скрипт нужен для отправки SMS через Sharepoint сервер.
Застропорился вот на этом моменте:
А вот создать объект: SPMobileMessageWebService messagingWebService = new SPMobileMessageWebService(account); не получается. Как мне переписать эту строчку на PS ? Нет такого свойства Account PS C:\temp> $a= [Microsoft.SharePoint.MobileMessage.SPMobileMessageWebService] PS C:\temp> $a| gm TypeName: System.RuntimeType Name MemberType Definition ---- ---------- ---------- Clone Method System.Object Clone() Equals Method bool Equals(System.Object obj), bool Equals(type o) FindInterfaces Method type[] FindInterfaces(System.Reflection.TypeFilter filter, System.Object filterCriteri FindMembers Method System.Reflection.MemberInfo[] FindMembers(System.Reflection.MemberTypes memberType, S GetArrayRank Method int GetArrayRank() GetConstructor Method System.Reflection.ConstructorInfo GetConstructor(System.Reflection.BindingFlags bindin GetConstructors Method System.Reflection.ConstructorInfo[] GetConstructors(System.Reflection.BindingFlags bin GetCustomAttributes Method System.Object[] GetCustomAttributes(bool inherit), System.Object[] GetCustomAttributes GetDefaultMembers Method System.Reflection.MemberInfo[] GetDefaultMembers() GetElementType Method type GetElementType() GetEvent Method System.Reflection.EventInfo GetEvent(string name, System.Reflection.BindingFlags bindi GetEvents Method System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr), S GetField Method System.Reflection.FieldInfo GetField(string name, System.Reflection.BindingFlags bindi GetFields Method System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr), S GetGenericArguments Method type[] GetGenericArguments() GetGenericParameterConstraints Method type[] GetGenericParameterConstraints() GetGenericTypeDefinition Method type GetGenericTypeDefinition() GetHashCode Method int GetHashCode() GetInterface Method type GetInterface(string fullname, bool ignoreCase), type GetInterface(string name) GetInterfaceMap Method System.Reflection.InterfaceMapping GetInterfaceMap(type ifaceType) GetInterfaces Method type[] GetInterfaces() GetMember Method System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.MemberTypes ty GetMembers Method System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr), GetMethod Method System.Reflection.MethodInfo GetMethod(string name, System.Reflection.BindingFlags bin GetMethods Method System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr), GetNestedType Method type GetNestedType(string fullname, System.Reflection.BindingFlags bindingAttr), type GetNestedTypes Method type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr), type[] GetNestedTyp GetObjectData Method System.Void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System. GetProperties Method System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingA GetProperty Method System.Reflection.PropertyInfo GetProperty(string name, System.Reflection.BindingFlags GetType Method type GetType() InvokeMember Method System.Object InvokeMember(string name, System.Reflection.BindingFlags bindingFlags, S IsAssignableFrom Method bool IsAssignableFrom(type c) IsDefined Method bool IsDefined(type attributeType, bool inherit) IsInstanceOfType Method bool IsInstanceOfType(System.Object o) IsSubclassOf Method bool IsSubclassOf(type type) MakeArrayType Method type MakeArrayType(), type MakeArrayType(int rank) MakeByRefType Method type MakeByRefType() MakeGenericType Method type MakeGenericType(type[] instantiation) MakePointerType Method type MakePointerType() ToString Method string ToString() Assembly Property System.Reflection.Assembly Assembly {get;} AssemblyQualifiedName Property System.String AssemblyQualifiedName {get;} Attributes Property System.Reflection.TypeAttributes Attributes {get;} BaseType Property System.Type BaseType {get;} ContainsGenericParameters Property System.Boolean ContainsGenericParameters {get;} DeclaringMethod Property System.Reflection.MethodBase DeclaringMethod {get;} DeclaringType Property System.Type DeclaringType {get;} FullName Property System.String FullName {get;} GenericParameterAttributes Property System.Reflection.GenericParameterAttributes GenericParameterAttributes {get;} GenericParameterPosition Property System.Int32 GenericParameterPosition {get;} GUID Property System.Guid GUID {get;} HasElementType Property System.Boolean HasElementType {get;} IsAbstract Property System.Boolean IsAbstract {get;} IsAnsiClass Property System.Boolean IsAnsiClass {get;} IsArray Property System.Boolean IsArray {get;} IsAutoClass Property System.Boolean IsAutoClass {get;} IsAutoLayout Property System.Boolean IsAutoLayout {get;} IsByRef Property System.Boolean IsByRef {get;} IsClass Property System.Boolean IsClass {get;} IsCOMObject Property System.Boolean IsCOMObject {get;} IsContextful Property System.Boolean IsContextful {get;} IsEnum Property System.Boolean IsEnum {get;} IsExplicitLayout Property System.Boolean IsExplicitLayout {get;} IsGenericParameter Property System.Boolean IsGenericParameter {get;} IsGenericType Property System.Boolean IsGenericType {get;} IsGenericTypeDefinition Property System.Boolean IsGenericTypeDefinition {get;} IsImport Property System.Boolean IsImport {get;} IsInterface Property System.Boolean IsInterface {get;} IsLayoutSequential Property System.Boolean IsLayoutSequential {get;} IsMarshalByRef Property System.Boolean IsMarshalByRef {get;} IsNested Property System.Boolean IsNested {get;} IsNestedAssembly Property System.Boolean IsNestedAssembly {get;} IsNestedFamANDAssem Property System.Boolean IsNestedFamANDAssem {get;} IsNestedFamily Property System.Boolean IsNestedFamily {get;} IsNestedFamORAssem Property System.Boolean IsNestedFamORAssem {get;} IsNestedPrivate Property System.Boolean IsNestedPrivate {get;} IsNestedPublic Property System.Boolean IsNestedPublic {get;} IsNotPublic Property System.Boolean IsNotPublic {get;} IsPointer Property System.Boolean IsPointer {get;} IsPrimitive Property System.Boolean IsPrimitive {get;} IsPublic Property System.Boolean IsPublic {get;} IsSealed Property System.Boolean IsSealed {get;} IsSerializable Property System.Boolean IsSerializable {get;} IsSpecialName Property System.Boolean IsSpecialName {get;} IsUnicodeClass Property System.Boolean IsUnicodeClass {get;} IsValueType Property System.Boolean IsValueType {get;} IsVisible Property System.Boolean IsVisible {get;} MemberType Property System.Reflection.MemberTypes MemberType {get;} MetadataToken Property System.Int32 MetadataToken {get;} Module Property System.Reflection.Module Module {get;} Name Property System.String Name {get;} Namespace Property System.String Namespace {get;} ReflectedType Property System.Type ReflectedType {get;} StructLayoutAttribute Property System.Runtime.InteropServices.StructLayoutAttribute StructLayoutAttribute {get;} TypeHandle Property System.RuntimeTypeHandle TypeHandle {get;} TypeInitializer Property System.Reflection.ConstructorInfo TypeInitializer {get;} UnderlyingSystemType Property System.Type UnderlyingSystemType {get;} PS C:\temp> $a| gm -Static TypeName: Microsoft.SharePoint.MobileMessage.SPMobileMessageWebService Name MemberType Definition ---- ---------- ---------- Equals Method static bool Equals(System.Object objA, System.Object objB) ReferenceEquals Method static bool ReferenceEquals(System.Object objA, System.Object objB) |
||||
|
|||||
pirojok |
|
|||
![]() Новичок Профиль Группа: Участник Сообщений: 34 Регистрация: 11.11.2007 Репутация: нет Всего: нет |
В итоге это был баг, после перезапуска консоли всё заработало.
Вот итоговая функция, вдруг кому пригодиться:
|
|||
|
||||
![]() ![]() ![]() |
Прежде чем создать тему, посмотрите сюда: | |
|
Используйте теги [code=csharp][/code] для подсветки кода. Используйтe чекбокс "транслит" если у Вас нет русских шрифтов. Что делать если Вам помогли, но отблагодарить помощника плюсом в репутацию Вы не можете(не хватает сообщений)? Пишите сюда, или отправляйте репорт. Поставим :) Так же не забывайте отмечать свой вопрос решенным, если он таковым является :) Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, mr.DUDA, THandle. |
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | Общие вопросы по .NET и C# | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |