Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

alex1205

@alex1205
About
Posts
32
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Allowing Impersonation on WCF Duplex Channel
    A alex1205

    I've tried to allow impersonation on a WCF duplex channel, however it is always complaining (InvalidOperationException at runtime) that one of my callback method does not allow impersonation. Sample code below: [ServiceContract(Namespace = "MyNamespace", SessionMode = SessionMode.Allowed, CallbackContract = typeof(IMyContractCallback))] public interface IMyContract { [OperationContract(IsOneWay = false)] void Method1(string param); } public interface IMyContractCallback { [OperationContract(IsOneWay = false)] ReplyData Callback1(); } [DataContract(Namespace = "MyNamespace")] public class ReplyData { public ReplyData(object data) { this.data = data; } [DataMember] public object data; } Implementation: Set service host ImpersonateCallerForAllOperations to true: serviceHost.Authorization.ImpersonateCallerForAllOperations = true; Allow impersonation to Implementing Methods: [OperationBehavior(Impersonation = ImpersonationOption.Allowed)] public void Method1(string param) { ... } [OperationBehavior(Impersonation = ImpersonationOption.Allowed)] public ReplyData Callback1() { ... } I always got the error message below: System.InvalidOperationException: The service operation 'Callback1' that belongs to the contract with the 'IMyContract' name and the 'MyNamespace' namespace does not allow impersonation. at System.ServiceModel.Dispatcher.SecurityValidationBehavior.WindowsIdentitySupportRule.Validate(ServiceDescription description) at System.ServiceModel.Dispatcher.SecurityValidationBehavior.System.ServiceModel.Description.IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase) at System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.ServiceHostBase.InitializeRuntime() at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open() Did I forgot to set something? Thanks in advance for the help. :)

    (:)

    WCF and WF help csharp wcf security question

  • Impersonation with IPCChannel
    A alex1205

    Yes. I was wondering why it doesn't allow me to instantiate a remoting object, when I'm running on an impersonated account.

    SDE

    C# sysadmin csharp json help question

  • PerfMon CPU Usage not same as Task Manager reading
    A alex1205

    Perspx wrote:

    In the left pane click on Reliability and Performance.

    Could not see this. :( I am using windows XP perfmon. Is this the same process that is mentioned above? Thanks.

    SDE

    System Admin performance question

  • Impersonation with IPCChannel
    A alex1205

    Hi, I am trying to connect to IPCChannel using an impersonated user and had encountered an Access Denied exception. Have anyone encountered this? Please help. Please see some code snippets below: Server: BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; System.Collections.IDictionary props = new System.Collections.Hashtable(); props["portName"] = "TestRemoteObject"; props["name"] = "TestRemoteObject"; props["authorizedGroup"] = "Everyone"; props["impersonate"] = true; props["secure"] = true; serverChannel = new IpcServerChannel(props, serverProvider); ChannelServices.RegisterChannel(serverChannel, true); RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject), "TestRemoteObject", WellKnownObjectMode.Singleton); Client: BinaryClientFormatterSinkProvider clientSink = new BinaryClientFormatterSinkProvider(); System.Collections.IDictionary clientProps = new System.Collections.Hashtable(); clientProps["secure"] = true; clientProps["tokenImpersonationLevel"] = TokenImpersonationLevel.Delegation; IpcClientChannel clientChannel = new IpcClientChannel(clientProps, clientSink); ChannelServices.RegisterChannel(clientChannel, true); // Impersonate user to use Administrator IntPtr token; bool result = LogonUser( "Administrator", "MyMachine", "MyPassword", LogonTypes.Network, LogonProviders.Default, out token); if (result) { WindowsIdentity identity = new WindowsIdentity(token); using (WindowsImpersonationContext imp = identity.Impersonate()) { try { RemoteObject remote = (RemoteObject)Activator.GetObject(typeof(RemoteObject), "ipc://TestRemoteObject/TestRemoteObject"); message = remote.Echo("Test"); } catch (Exception exc) { message = exc.ToString(); } imp.Undo(); }

    C# sysadmin csharp json help question

  • PerfMon CPU Usage not same as Task Manager reading
    A alex1205

    Sorry for the late response. Been very busy.

    Perspx wrote:

    Expand the CPU section in the PerformanceMonitor and check the CPU readings for processes that are running against the CPU readings for processes in the Task Manager, where do the differences lie?

    How do I do this? (Sorry newbie here)

    Perspx wrote:

    How different are the readings?

    Very different. Task Manager Says 10% while PerfMon goes to 20% (1 second sampling). :)

    SDE

    System Admin performance question

  • PerfMon CPU Usage not same as Task Manager reading
    A alex1205

    Thanks. :)

    SDE

    C# performance question

  • PerfMon CPU Usage not same as Task Manager reading
    A alex1205

    Hi, I am trying to create a CPU Usage monitoring application. I am using PerformanceMonitor to do it. However as I was observing the data from Task Manager's CPU Usage column (Process Tab) and Performance Monitor (Process - % Processor Time) readings, they don't seem to coincide at all (Not even close). I tried to change the Performance Monitors sampling interval, but I can't seem to make the 2 coincide. Does anyone, know why the readings are different? Thanks. :)

    SDE

    C# performance question

  • PerfMon CPU Usage not same as Task Manager reading
    A alex1205

    Hi, I am trying to create a CPU Usage monitoring application. I am using PerformanceMonitor to do it. However as I was observing the data from Task Manager's CPU Usage column (Process Tab) and Performance Monitor (Process - % Processor Time) readings, they don't seem to coincide at all (Not even close). I tried to change the Performance Monitors sampling interval, but I can't seem to make the 2 coincide. Does anyone, know why the readings are different? Thanks. :)

    SDE

    System Admin performance question

  • Invalidated ADO Connection Object
    A alex1205

    Hi, Thanks for the response. I've tried that and it doesn't work. I also tried looking at the error count but it doesn't report any. :) SDE

    Database sysadmin help tutorial question

  • Invalidated ADO Connection Object
    A alex1205

    Hi, Anybody knows how to know if an ADO connection has been disconnected even before you execute anything? I have an application which has a global connection object and when it was disconnected from the server for whatever reason, it raises an error when you execute something even if the connection has been restored. Is there a way which I could know if the connection is still valid before I even execute anything? Thanks SDE

    Database sysadmin help tutorial question

  • Farsi Language Support in Visual Basic
    A alex1205

    Hi, Thanks for the information. How bout Shamsi dates? I have been looking information about it. I wanted an introduction to it on how it would affect my app... Do you have any article you could recommend? Thanks. SDE

    Visual Basic help question

  • Farsi Language Support in Visual Basic
    A alex1205

    Hi. Thanks for the response. MOst of the controls I'm using supports Arabic Right-To-Left. However, I am wondering whether there is a difference with Arabic and Farsi support. I guess there are some characters in Farsi which are not supported by Visual Basic 6. Have you heard of this issue? Thank you. SDE

    Visual Basic help question

  • Farsi Language Support in Visual Basic
    A alex1205

    Hi, I am investigating on how Visual Basic 6 could fully support Farsi Characters. I have heard that there are some characters which are not supported. Although I dont know which ones they are. Could anyone help me? SDE

    Visual Basic help question

  • Farsi Support for Visual Basic
    A alex1205

    Hi, I am investigating on how Visual Basic 6 could fully support Farsi Characters. I have heard that there are some characters which are not supported. Although I dont know which ones they are. Could anyone help me? SDE -- modified at 6:43 Monday 29th August, 2005

    IT & Infrastructure help question

  • Converting String to Byte Arrays
    A alex1205

    Hi, I am trying to convert a unicode string containing characters with different code page (Basically a set of hex data stored in a string). When I tried to convert them they somehow get mixed up by VB. Does anybody know of a low level way of converting strings to Byte array? I am using VB6 by the way. Thanks. SDE

    Visual Basic data-structures question

  • Remote query being executed multiple times
    A alex1205

    Hi, I have a remote query which i invoked using sp_ExecuteSQL. Using the SQL Profiler, I found out that the query is being executed 6 times instead of only ones. Does anyone know how to prevent this from happening? I am using ADO in VB6. Thanks. SDE

    Database database sharepoint tutorial question

  • Persisting an object into DB
    A alex1205

    Hi, Please help. I have a specific object which holds multiple collections of objects inside which I want to save/persist into the database. I am using VB6 and SQL Server 2000. Does anyone know how to do this? Thanks. SDE

    Visual Basic database sql-server sysadmin help

  • Listing down available domains programmatically
    A alex1205

    Hi, Is there anyone who knows how to enumerate all the available domains on a network. I want to list them down on a combo box. (Same as Windows login). Thanks. Ü SDE

    C / C++ / MFC sysadmin tutorial

  • Weird <= operation
    A alex1205

    Hi, I have encountered a problem with a very basic operation. does anybody have any idea about this? Please see sample code below: ////////////////////////////////////////// double a, b; a = 99.99 b = 99.99 if (a <= b){ ::MessageBox(NULL, L"TRUE", L"", MB_OK); } else{ ::MessageBox(NULL, L"FALSE", L"", MB_OK); } ////////////////////////////////////////// somehow, it always display FALSE. Anybody knows how to handle this situation? SDE

    C / C++ / MFC help tutorial question

  • Sending Textbox Entry to the Printer
    A alex1205

    OK. Thanks. SDE

    Visual Basic question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups