.net-4.0

web.config authorization deny unauthorised

家住魔仙堡 提交于 2020-01-01 06:51:17
问题 I am developing a .NET for ASP.NET Web Application and am trying to deny all users who are unauthorised from accessing my application but allowing them only to the login page. Below is a snippet of the code which is inside my system.web section: <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="60" name="APPNAME" slidingExpiration="true" /> </authentication> <authorization> <deny users="?" /> </authorization> I also have this outside to allow access to the login page:

Playing ohLibSpotify pcm data stream in C# with NAudio

血红的双手。 提交于 2020-01-01 06:37:11
问题 I'm trying to play raw pcm data delivered from ohLibSpotify c# library (https://github.com/openhome/ohLibSpotify). I get the data in the following callback: public void MusicDeliveryCallback(SpotifySession session, AudioFormat format, IntPtr frames, int num_frames) { //EXAMPLE DATA //format.channels = 2, format.samplerate = 44100, format.sample_type = Int16NativeEndian //frames = ? //num_frames = 2048 } Now i want to directly play the received data with NAudio (http://naudio.codeplex.com/).

Problems deploying a WinForms app that uses Microsoft ReportViewer

三世轮回 提交于 2020-01-01 05:06:20
问题 I have published a WinForms application from Visual Studio 2010. It uses .NET 4.0. in the prerequisite dialog in Publish pane I selected .NET 4.0 Client Profile and Windows Installer 3.0. After publishing application to disk, I migrated it to client's computer which first installed .NET Client Profile and after reboot it gave following error message: Unable to Install or run application. The application requires that assembly, Microsoft.ReportViewer.Common version 10.0.0 in global assembly

Is this a correct use of Thread.MemoryBarrier()?

本小妞迷上赌 提交于 2020-01-01 04:14:05
问题 Assume I have a field that controls execution of some loop: private static bool shouldRun = true; And I have a thread running, that has code like: while(shouldRun) { // Do some work .... Thread.MemoryBarrier(); } Now, another thread might set shouldRun to false , without using any synchronization mechanism. As far as I understand Thread.MemoryBarrier(), having this call inside the while loop will prevent my work thread from getting a cached version of the shouldRun , and effectively

How to achieve Asynchrony instead of Parallelism in F#

筅森魡賤 提交于 2020-01-01 03:18:49
问题 (Sticking to a common example with async fetch of many web pages) How would I spin off multiple (hundreds) of web page requests asynchronously, and then wait for all requests to complete before going to the next step? Async.AsParallel processes a few requests at a time, controlled by number of cores on the CPU. Grabbing a web page is not a CPU-bound operation. Not satisfied with the speedup of Async.AsParallel, I am looking for alternatives. I tried to connect the dots between Async

Style TargetType causes XamlParseException when not attached to debugger

寵の児 提交于 2020-01-01 02:16:08
问题 I have a very simple set of styles that I'm using in a couple of different WPF applications. I have this style stored in a Xaml file in a common project, then added by merging into the Resources in App.xaml in each of the projects. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:i="clr-namespace:System.Windows.Interactivity

Extract PDF text by coordinates

别等时光非礼了梦想. 提交于 2020-01-01 00:42:07
问题 I'd like to know if there's some PDF library in Microsoft .NET being able of extracting text by giving coordinates. For example ( in pseudo-code ): PdfReader reader = new PdfReader(); reader.Load("file.pdf"); // Top, bottom, left, right in pixels or any other unit string wholeText = reader.GetText(100, 150, 20, 50); I've tried to do so using PDFBox for .NET (that one working on top of IKVM) with no luck, and it seems to be very outdated and undocumented. Perhaps anyone has a good sample of

How to create start menu shortcut

泄露秘密 提交于 2019-12-31 21:09:39
问题 I am building a custom installer. How can I create a shortcut to an executable in the start menu? This is what I've come up with so far: string pathToExe = @"C:\Program Files (x86)\TestApp\TestApp.exe"; string commonStartMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu); string appStartMenuPath = Path.Combine(commonStartMenuPath, "Programs", "TestApp"); // TODO: create shortcut in appStartMenuPath I'm targeting Windows 7. 回答1: Using the Windows Script Host (make

In-Place Compilation using ClientBuildManager.CompileFile

China☆狼群 提交于 2019-12-31 20:39:47
问题 I'm working on a website that I'd like to use in-place compilation on in order to make the first hit faster. I'd like to use the ClientBuildManager.CompileFile method to do the in-place compilation so that I have control of the compiling process. For a variety of reasons, this is the ideal way to compile this website. Why Does IIS Build to a Different Subdirectory under "Temporary ASP.NET Files"? When I compile a website file by file via ClientBuildManager.CompileFile method in an exe built

In-Place Compilation using ClientBuildManager.CompileFile

情到浓时终转凉″ 提交于 2019-12-31 20:39:08
问题 I'm working on a website that I'd like to use in-place compilation on in order to make the first hit faster. I'd like to use the ClientBuildManager.CompileFile method to do the in-place compilation so that I have control of the compiling process. For a variety of reasons, this is the ideal way to compile this website. Why Does IIS Build to a Different Subdirectory under "Temporary ASP.NET Files"? When I compile a website file by file via ClientBuildManager.CompileFile method in an exe built