Hans Muster's Library tagged → View Popular
CodeProject: ExifLibrary for .NET. Free source code and programming help
To extract Exif metadata from a JPEG/Exif image, create an instance of the ExifData class with the path to the image file. The ExifData class reads the APP1 section, and extracts all Exif tags and also the embedded thumbnail (if any). For ease of use, this Exif library converts Exif tags to either .NET native types or custom classes. Date fields are returned as DateTime structures, GPS coordinates are wrapped with custom GPSLatitudeLongitude classes, etc.
CodeProject: Create Custom Application Block Using .Net Enterprise Library. Free source code and programming help
"This white paper is written in a view to help developer to create custom application block using .net Enterprise Library."
Chaks' Corner | Using KeywordQuery to search in your SharePoint site
There are various ways that you can query the Search Service in your SharePoint site:
1) Using the Search Web Service
2) Using the SharePoint Object Model
There are yet again two ways you can use the Search, using the Object Model:
i) KeywordQuery
ii) FullTextSqlQuery
I think it is a good option to use Object Model when you want to customize the Search (mostly in your WCM websites), and KeywordQuery comes in very handy!
Using KeywordQuery to search is pretty simple! (provided you have set up your Search properly)
C# - UNC-Pfad ermitteln
Mit diesem Snippet kann man einen UNC-Pfad aus einem Pfad erstellen lassen.
Sollte es nicht möglich sein einen UNC-Pfad zu erstellen wird ein leerer String zurück gegeben.
The wrong way to iterate through SharePoint SPList Items
There are multiple ways to iterate through the items of a SharePoint list by using the SharePoint Object Model. One approach - which I’ve seen before in a real life SharePoint Application - may work fine on the developers machine or on very tiny lists. But it is going to ruin your performance once executed on a list that exceeds a couple of hundred items.
Writing to the SharePoint Unified Logging Service – Windows Live
Writing to the SharePoint Unified Logging Service
SharePoint uses a logging service that makes entries in the log files located at Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS. Out-of-the-box, SharePoint logs almost everything to these files, and I have seen them get quite large. Therefore, you should "throttle" the log writing, which can be done in the "Diagnostic Logging" section of the Central Administration site.
Once you discover the log files, you'll want to be able to write to them from your own features. This is a pretty easy thing to do, because the SharePoint SDK has a complete sample with code you can reuse. I use this code regularly in my features, so I have packaged it into a class that you can download here. Simply add the class to your project and then you can write to the logs using something like the following code.
TraceProvider.RegisterTraceProvider();
TraceProvider.WriteTrace(TraceProvider.TagFromString("XXXX (must be 4 letter tag)"), TraceProvider.StringToSeverity("Exception or Information"), Guid.NewGuid(), "Method Name", "Assembly Name", "Project Name", "Message");
TraceProvider.UnregisterTraceProvider();
Once you start writing to the log files, you'll discover that there is no easy way to view them. SharePoint does not have a log viewer built into the Central Administration web site. I've written an additional feature for viewing logs that you can download from my CodePlex project.
hudson: an extensible continuous integration engine
Hudson monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, current Hudson focuses on the following two jobs:
1. Building/testing software projects continuously, just like CruiseControl or DamageControl. In a nutshell, Hudson provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.
2. Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Hudson keeps those outputs and makes it easy for you to notice when something is wrong.
C# WebServer - Home
This project is a flexible http server which can be embedded in any .Net application. It has a modular design where features are added using modules. The server also supports REST and all http verbs (and not just GET). More info about the core: Core
The modular design allows you to use a small specific part or get a fully blown MVC webserver.
1. Just use the (framework included, not System.Net.) HttpListener, to take care of everything yourself
2. Use the httpserver, that also gives you better response handling and sessions.
3. Add the file module, which also allows the server to serve files under a specific directory/subdirectories (you can also use multiple file modules).
4. Add the controller module to be able to use controllers.
5. Use the template manager in your controllers to get views.
6. Use ViewController to integrate views in the controllers (adds some Render methods).
See? Modular design that doesn't force you to use more functions than you need.
Holiday Goodie Bag: Free C# and VB Coding Standards Reference Documents
I present to you the latest incarnations of my efforts: a zip file containing C# and VB.NET editions of my reference coding standards. I've been holding these for the holidays so that I could share a little something extra with my readers as the year winds down. I certainly don't expect everyone to agree with my standards but I hope by posting these, you can get a head start towards documenting your own.
C# - Threadsichere GUI Änderungen
Wenn man aus einem Background Thread mit der UI einer Windows Forms anwendung kommunizieren (Werte ändern) möchte, muss man dies mittels Invoke machen, nachfolgendes Snippet zeigt wie man sich schnell eine einfache Methode schreiben kann die selbst entscheidet ob ein Invoke von Nöten ist oder nicht.
Escape Sequences
Escape Sequences
Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called "escape sequences." To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences. An escape sequence is regarded as a single character and is therefore valid as a character constant.
Moldenco: SPSecurity.RunWithElevatedPrivileges to update SPRoleAssignment of an SPListItem
When you write custom code in Sharepoint webparts, your code will run with your credentials.
Not everybody has Full Control, so when a user has only read rights, the code will throw an access denied error when the code needs access to objects that are not in the scope of the user credentials.... (example: add the username in the ReadBy properties of an item).
Apache log4net - Apache log4net: Home
log4net is a tool to help the programmer output log statements to a variety of output targets. log4net is a port of the excellent log4j framework to the .NET runtime. We have kept the framework similar in spirit to the original log4j while taking advantage of new features in the .NET runtime. For more information on log4net see the features document.
log4net is part of the Apache Logging Services project. The Logging Services project is intended to provide cross-language logging services for purposes of application debugging and auditing.
CodeProject: Howto: (Almost) Everything In Active Directory via C#. Free source code and programming help
Howto: (Almost) Everything In Active Directory via C#
Quick List for C# Code Examples
This topic contains links to all of the C# code examples contained in the Using System.DirectoryServices guide.
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in c#
-
Dotnet
This is for dotnet, c#, Sil...
Items: 20 | Visits: 36
Created by: Alok Ranjan
-
C# and VB .net Programing
Codes and techniques of pro...
Items: 43 | Visits: 101
Created by: stefan stoichev
-
.net
Items: 97 | Visits: 43
Created by: Jefferson Chow
Diigo is about better ways to research, share and collaborate on information. Learn more »
Join Diigo
