Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all 8156 articles
Browse latest View live

Are there any existing gigh performance Socket libraries?

$
0
0

I am reading the sample code about the SocketAsyncEventArgs. The sample code aims at high performance by pre-allocating needed buffers. I am debugging the code to evaluate how would I inorporate the code into real projects.

Meanwhile, I would like to know if there are any existing (open source) libaries built around SocketAsyncEventArgs. If there are mature ones, I would gladly to use them to save time. Thanks for any advices.


Ignorance is blissful


HoW To Set Net FrameWork Fast

$
0
0
hello guys i just curious about how to setting netframework to be fast in my pc i always have  the problem to make it perfect

Two factor authentication with device secret?

$
0
0

Hi,

we use two factor authentication to access Project Online PWA.

We are looking to interrogate/integrate the PWA data with a service call.

Is there a way of creating a 'device secret' and implement it into c# code, callable from a service?

Thanks

Stew

getting value of dynamic variable

$
0
0

hello, I am getting a problem while reteriving a value from dynamic variable

I have a dynamic variable of type Class it is having Properties like Name,Age etc

 so how to get the value  dynamic d= classObject

d.Age while Accessing these line I am getting Error

 

CSharpScript can't get basic example script to work

$
0
0

var scriptText=@"using System;
using System.Windows.Forms; 
class Script

    static void Main()
    {
        MessageBox.Show( "Hello World!"); 
    }
}";

var scriptOptions = ScriptOptions.Default;

var mdr = new MetadataReference[] {                    MetadataReference.CreateFromFile(this.GetType().Assembly.Location),
MetadataReference.CreateFromFile(TypeExtensions.GetSystemAssemblyPathByName("System.Windows.Forms.dll")),
MetadataReference.CreateFromFile(TypeExtensions.GetSystemAssemblyPathByName("System.dll"))};

scriptOptions.AddReferences(mdr);

var script=CSharpScript.Create(scriptText, scriptOptions);

script.RunAsync();

Exception:  error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

I have tried scriptOptions.AddReference("System.Windows.Forms.dll") to no avail.

I have also tried css_reference System.Windows.Forms.dll;

In the debugger I can see that the metadataReferences are set directly to the correct paths for the system dlls, however it does not recognize the System.Windows namespace.





Windows 10 Insider Builds and Default RSA Provider

$
0
0
If this is more appropriate to post elsewhere since this is fundamentally about the Insider builds for Windows 10, I apologize in advance. I have an application that I've been running for a long time from build to build of Windows 10. This is the first time I tried to run said application on an Insider build. I noticed that my encryption for my connection strings was failing with an inner exception, apparently because this build either lacks the default RSA provider or the underlying machine certs to allow for encryption. I went back and retested this on a production build and it's fine. So my question is very simply, is it by design that these early builds would not have the default infrastructure for the RSA provider or should I report this as a bug in the build?

WSTrust,STS support on .Net Core

$
0
0

Hello!

There is any support for WSTrust STS on .Net Core ?

I want to do this in .net core:

else { binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName; ep = new EndpointAddress("https://abc.com/adfs/services/trust/13/usernamemixed"); } factory = new WSTrustChannelFactory(binding, ep); factory.TrustVersion = TrustVersion.WSTrust13; factory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials; var rst = new RequestSecurityToken { RequestType = RequestTypes.Issue, AppliesTo = new EndpointReference("urn:adfsmonitor"), KeyType = KeyTypes.Bearer, }; IWSTrustChannelContract channel = factory.CreateChannel(); GenericXmlSecurityToken genericToken = channel.Issue(rst) as GenericXmlSecurityToken; return genericToken.TokenXml.InnerXml.ToString();

Thanks in advance



Help please!!! (80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). )

$
0
0

I have just created a simple web site using VB in VS2010 with reference to SourceSafe using Interop.SourceSafeTypeLib.dll, but I'm having lots of trouble on publishing it!!!

In VS everything works fine, but after publishing on the webserver I get the following error:

Retrieving the COM class factory for component with CLSID {783CD4E4-9D54-11CF-B8EE-00608CC9A71F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). 

HELP PLEASE!!!!

I'm in big trouble if I can't get this done fast....

 

Sorry if my english is not to good!!!



Get List of Users and "Member Of" list on local machine in C#

$
0
0

Hello, how can I get the info you see in the Computer Management Console under Local Users and Groups.

I need to be able to see a list of users and for each user the "member of" list as you would see in on this properties tab?

I would to catch if someone setup "HomeUsers" for the main account and T4CAdmin account as this causes many permission issues with our software. So if a tool is able to detect this, it would speed up troubleshooting as well as getting them to setup the PC correctly from the start.

Access Denied Error on PerformanceCounterCategory.GetCategories(string machineName) call --- URGENT

$
0
0
Hello to all:

I want to get the performance counter categories of the remote computer and i am using the PerformanceCounterCategory.GetCategories(string machineName) method to retrieve the required information from the desired machine. But every time i recieve the "Access Denied" error. I don't know why i am getting this error.

I have even turend all the firewalls off but its not working.

Please if any one have a solution to this problem, please post as soon as you can.
Its URgent.

Thanks

Regards

Shoaib

Introduction to System.DirectoryServices.Protocols (S.DS.P) Issue with upload certificate list

$
0
0

Hi,

Currenty I am working on S.DS.P.

As per my project requirement I am tring to upload Certificate and Certificate List (Ldap Datatype) , I am able to upload Certificate data type but when I am tring to uplaod Certificate List Dataype then it is not working.

For single Certificate below code is working fine. Could you help me for uploading the certificate list. what should i changes in below code.

      // The path to the certificate.
      string Certificate = "localhost.cer";

      // Load the certificate into an X509Certificate object.
         X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);

       // Get the value.
           byte[] results = cert.GetRawCertData();

       var dirAtr = new DirectoryAttribute("ManufacturerDeviceCertificate;binary", results);

As I tring the below code for multiple certificate whihc is not working.

 new DirectoryAttribute("OperationalCertificates;binary",new byte[][] {results,results,results });

Please help me for creating the DirectoryAttribute for Certificate List Datatype.

Thanks

Shreyansh Jain

The instance of SQL Server you attempted to connect to requires encryption but this machine does not support it.

$
0
0

Iam trying to connect Azure SQL from Console app or Asp.net web application   in Windows Server 2008 r2  with .Net framework 4.5.1 using Entity framework 5.0 installed and getting the below error . The connecting string and every thing looks fine and same  application connecting from local windows 10 environment machine

Unhandled Exception: System.Data.EntityException: The underlying provider failed  to Open. ---> System.Data.SqlClient.SqlException: The instance of SQL Server you  attempted to connect to requires encryption but this machine does not support it.

Has any one faced this issue



Enquiry: How to retrieve the published user certificate in Active Directory

$
0
0

 

Hi Everybody,

 

I have a question about Active directory & C#. I would like to write a code in Visual C# that can retrieve the published user certificate in Active directory. Actually I want to list all users domain & the issued certificates to all of them. Can Anyone help me on this. I will appreciate that. I am still beginner in Visual C#, but because I am familiar with JAVA language and C# is too close to it, SO I can survive >>>

 

 

Plz help me on this issue.

 

Regards

Mahmoud

LISTVIEW GROUPS

$
0
0

I have a System.Windows.Forms.ListView with View = Detail and SelectFullRow. I use grouping.

Consider the following scenario:
...
item A
Group Header
item B
...

Let item A be selected; when I press the down arrow selection passes to item B as expected, however the Group Header is highlighted by a dotted rectangle like the glyph indicating focus; pressing the down arrow again, the rectangle disappears but selection remains on item B. The same happens if now I press the up button.

As a result, scrolling through the list shows an annoying hysteresis when crossing the groups.

Have I missed any setting?




FileUpload class and FTP User

$
0
0

Dear .NET Experts,

I have looked at the definition for the file upload class (https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.fileupload?view=netframework-4.7.2) and wonder now,

where do I put the user information for the user (ftp) that has the right to the path directory?


dotnet core (2.2) razor page tag helpers add custom HTML targets

$
0
0

I use helper tags for label and select tags like so:

<select asp-for="Article.Countries.Id"></select>

I now want to use a custom tag multiselect into which a JS library hooks into.

I now want to use the tag helper expansion from select in this new tag:

<multiselect asp-for="Article.Countries.Id"></multiselect >

What is the safest way to extend the select-helper tag to also kick in for this new tag?

PipeSecurity on NamedPipeServerStream on .NET Standard / Core 2.0

$
0
0

Hello,

In my code (.NET Standard 2.0 Library) I'm trying to open a named pipe via NamedPipeServerStream and I can successfully consume that stream from a client process as long the Process User is the same.

But what I need is to set the security so, that all Authenticated Users can access the stream from the Client process.

e.g:

PipeSecurity ps = new PipeSecurity();
NamedPipeServerStream pipeServerStream = new NamedPipeServerStream(Globals.PIPE_NAME_ROUTER, PipeDirection.InOut, 2, PipeTransmissionMode.Message,PipeOptions.Asynchronous | PipeOptions.WriteThrough);

ps = pipeServerStream.GetAccessControl()

ps.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null), PipeAccessRights.ReadWrite, AccessControlType.Allow));

But the following call:

pipeServerStream.SetAccessControl(ps);

will fail with an "UnauthorizedAccessException" (even if my Server Process is in "Elevated Mode").

All hints I found in the Internet (for the full framework) propose to set the PipeSecurity in the NamedPipeServerStream constructor. But this is not available under .NET Standard 2.0.

Does any workaround exist to set any access rules from within the process?

Ralf

Console Application and PointF, SizeF

$
0
0

I am writing a console application that does geometric manipulations but does not attempt to draw anything on the screen.

Apparently if I want to do geometric manipulations, using classes and structs such as SizeF, PointF, etc.  I need to have a heading line "using System.Drawing;"  but this is not allowed in a console application.  This is unfortunate because I am basing this on code from a Windows Form application.

Is there any way that I can use these in a console application?  Am I missing something?

C# How to retrieve custom property value from derived class ToolStripMenuItem

$
0
0

For 3 days now I've been searching the answer to this seemingly easy question. 

I've created a class like so:

public class SourceMenuItem : ToolStripMenuItem

{

private string connection;

public string Conn
            {
                get
                {
                    return connection;
                }

                set
                {
                    connection = value;
                }
            }

}

My ToolStripMenuItem control is called SourceLeft System.Windows.Forms.ToolStripMenuItem

Here's how I dynamically add items

SourceMenuItem item = new SourceMenuItem();

item.Text = "drive c:";

item.Tag = "drive"; 

item.Conn = "my string to retrieve";

// (other stuff like ToolTipText, etc...)

SourceLeft.DropDownItems.Add(item);

And here's how I retrieve the values

string text = "";

string tag = "";

string conn = "";

int max = SourceLeft.DropDownItems.Count;                    

 

for (i = 0; i < max; ++i)
                {
                    text = SourceLeft.DropDownItems[i].Text;
                    tag = SourceLeft.DropDownItems[i].Tag.ToString(); // I have no problem retrieving those stored values.

                    // Here's where the problem starts
                    conn = SourceLeft.DropDownItems[i].Conn;
                }

The error message for .Conn is to be expected:

ToolStripItem does not contain a definition for 'Conn' and no accessible extension method 'Conn' accepting a first argument of type 'ToolStripItem' could be found.

I'm new to C# and couldn't find the answer about the code I'm missing to make this work: 

I wish to address the .Conn property the same way I do with .Text & .Tag 

Thank you for all your help

Have a nice day.


Aforge

$
0
0
Hello
I want to create a rectangle-like filterbox on my image and use this filterbox to process the image. I use the Aforge library.
Can you help me? Thank you.
Viewing all 8156 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>