Questions tagged ".net" (page No.1)

NetworkStream doesn't support seek operations

I'm creating simple proxy server but I faced a strange situation, I've following code : var clientRequestStream = _tcpClient.GetStream(); var requestHeader = clientRequestStream.GetUtf8String(); GetUtf8String is a extension method for Stream class which reads stream (contains HttpRequest headers). I need to extract those headers to access Host and Requested Url. Once reading NetworkStream is ...

Extract HTTP from string

Following line is from a webpage read, i am extracting urls of our site from the pages. I can extract most, however some of them look like the one below. "javascript:outside('http://www.xyz.com/graduation.html')"; I want to be able to extract the link starting with http://....... tried regex and split ...

Changing other columns value onselectedvaluechanged event in combobox in XtraGridView

Is there a way to get handle of row of which the selectionvalue is changed in combobox? Let me try to explain it using example. In GridView, I have two columns, Name, Type Type column has combobox, with values 1 and 2. What I want to do is on selecting value 1 in type column ...

.NET ISerializable Object nested in other of the same type. GetObjectData

I have an ASP.NET application (.NET 2.0) in a server that moved to StateServer session mode. Because of that I have to adapt all objects to be Serializable. Many of them encapsulates a DataRow, which is not Serializable. So, I implement Iserializable interface in those and stores its table (which is Serialization compatible) ...

Copying NetworkStream to MemoryStream takes infitity ∞ days

I've following code: _clientRequestStream = _tcpClient.GetStream(); var memoryStream = new MemoryStream(); _clientRequestStream.CopyTo(memoryStream); CopyTo takes long long long time to copy a Stream into another Stream. It seems application stops there ...

Cast byte string to human-readble old-fashion string

Good morning\evening everyone! i have a string in a format like "0x0SD30SV8GN48N84GN" wich represent a byte array... how can i turn that on a actual byte[]? the actual string is quite longer. It represents a string in UTF-8 format that im trying to convert to UTF-32... what i want is to turn that to ...

How to validate properties in 2 different situations in mvc 2 app?

please help me with asp.net MVC 2 application. I have class: public class Account { [Required(....)] [RegularExpression("....")] public string AccountCode{ get; set; } public string BankName{ get; set; } } And another one: public class BankPageModel { public bool ...

Download file through code that has a redirect?

I have some urls in the database. The problem is there urls are urls that redirect to what I want. I have something like this http://www.mytestsite.com/test/test/?myphoto=true now if I go to this site it would do a redirect to the photo so the url would end up being http://www.mytestsite.com/test/myphoto.jpg Is it ...

C# data structure to add elements in order

I am looking for a data structure in C# (.net framework) which I can use to add data in sorted order (instead of adding all data and then applying sort). My data are objects and I want to add them according to a certain field (integer field). Thanks ...

How to use the Google Api Client Library for .Net with Google Analytics

I am building an application (Console app) that needs to connect to Google Analytics to create and extract of some information. I would like to pass my credentials and not use OAuth. I downloaded the Google Api Client Library for .Net, but I don't see any samples on how to ...

Does anyone know of a PaaS provider that supports .NET and can open TCP and UDP sockets via system.net and/or unmanaged dll?

As the question suggests, Ive searched several providers to no avail. That all seem to support ASP.NET only. Even IronFoundry only supports ASP.NET? ...

Signed assembly seems to be loading unsigned (not using reflection)

I have three .NET 4.0 third party assemblies: Assembly.One is unsigned and references a signed Assembly.Two and unsigned Assembly.Three. Assembly.Two references a signed Assembly.Three. I've verified the above using reflector. I have been provided with an unsigned Assembly.One, signed Assembly.Two and unsigned Assembly.Three. I expected this to fall over when deployed as the signed Assembly.Two ...

deploying IronPython script or static building an application

I created an IronPython script that imports from Python libraries, such as os, sys, etc. as well as .NET libraries. It runs perfectly fine from my Visual Studio IronPython solution but I need to deploy this so other people who don't have IronPython or Python installed can run it. How would I ...

Print option with page range not setting correctly

PrinterSettings.FromPage = 1; PrinterSettings.ToPage =2; Whenever i send any range for ToPage as 2, when i check it always has its ToPage to 99, any thought? PrintDialog PrintDialog1 = new PrintDialog(); PrintDialog1.AllowSomePages = true; PrinterSettings.FromPage = 1; PrinterSettings.ToPage =2; also when i debug, i see ?PageSettings.PrinterSettings.PrintRange SomePages {2} instead of AllPages, so the printrange is setting the property for ...

Cooliris wall does not play videos

I am using Cooliris wall to show feed from picasa web album. The photos is shown very well, while the videos are not played at all (all video types). I read some posts about crossdomain xml , but I still don't know how to make it work. I read also a suggestion to ...

Given string.format formatting string return the type

Is it possible to do a reverse type lookup on string.format formatting strings. Say for example I have {0:0.00} formatting string. It's used to format a decimal. Can I pass it to a function and have it return the type in this case decimal. Or pass {0:y yy yyy yy} ...

Getting reference to IUnityContainer in static class

I am trying to get a reference to my container in a static class within my domain so that I can do something like this: public static class DomainEvents { public static IUnityContainer Container { get; set; } // ... public static void ...

Can .NET extensions not be accessed via reflections?

I've created an XNA application that utilizes LuaInterface (via Lua) to control many aspects of the application itself. I added an extension to an XNA class (specifically the KeyboardState object). The problem is, if I call the extended function with Lua, I get an error: Attempt to call field ...

« Previous12345678910 ... 62926293Next »Show All