c#-2.0

Compact Framework - Get Storage Card Serial Number

半腔热情 提交于 2019-11-30 21:51:04
Morning all, How would I go about getting the serial number of the storage/sd card on my mobile device? I am using C#.Net 2.0 on the Compact Framework V2.0. Thanks. The Smart Device Framework provides a mechanism to get SD Card serial numbers and manufacturer IDs. I'm not on a machine that I can get the syntax for you but I believe you can use the System.IO namespace to get IO based attributes. First get a DirectoryInfo to the storage card. (I'm not 100% on the code here, you may need to test, I'll update it if I can get to my machine) public DirectoryInfo GetStorageCard() { DirectoryInfo

jquery ajax with asp.net not working

半腔热情 提交于 2019-11-30 21:02:23
I'm about to pull out any remaining hair that I have, so please help me out if you know what the problem might be... Thanks. All my googling and searching has not paid off either. First, I'm using jquery-1.7.2.min.js and ASP.net 2.0 web form. I'm trying to make an ajax call using jquery but keep getting syntax error/parse error messages. I've tried many different ways but they all result in the error when I set the dataType to json. Here's what I have: $.ajax({ type: "POST", url: "UserList.aspx/GetTestJson", data: {}, //have also tried "{}" and other options such as removing the line

DataGridview cells of one column can't have different type

倾然丶 夕夏残阳落幕 提交于 2019-11-30 21:00:24
well I have a datagridview , and i have a column, all i want to do is controlling the cells in this column, sometimes make it combobox, sometimes textBox ....etc I can make the cells of a column have only one type , can i make many cells type in one column ? hope it is clear . Haris Hasan There are two ways to do this: Cast a DataGridViewCell to a certain cell type that exists. For example, convert a DataGridViewTextBoxCell to DataGridViewComboBoxCell type. Create a control and add it into the controls collection of DataGridView, set its location and size to fit the cell that to be host. See

Accessing deleted rows from a DataTable

穿精又带淫゛_ 提交于 2019-11-30 20:07:12
I have a parent WinForm that has a MyDataTable _dt as a member. The MyDataTable type was created in the "typed dataset" designer tool in Visual Studio 2005 (MyDataTable inherits from DataTable) _dt gets populated from a db via ADO.NET. Based on changes from user interaction in the form, I delete a row from the table like so: _dt.FindBySomeKey(_someKey).Delete(); Later on, _dt is passed by value to a dialog form. From there, I need to scan through all the rows to build a string: foreach (myDataTableRow row in _dt) { sbFilter.Append("'" + row.info + "',"); } The problem is that upon doing this

C# variable length args, which is better and why: __arglist, params array or Dictionary<T,K>?

大憨熊 提交于 2019-11-30 19:51:05
I recently read the following overflow post: Hidden Features of C# One of the features pointed out was the arglist. Why would one choose this or the alternatives as a means of using a variable length argument list to a method? Also, note that I would probably not use this kind of construct in my code unless a corner case warranted doing so. This is more of a question of semantics than whether it is even practical or prudent to even use variable length arguments. So does anyone know which is better and why? [Test] public void CanHandleVariableLengthArgs() { TakeVariableLengthArgs(__arglist(new

Compact Framework - Get Storage Card Serial Number

我只是一个虾纸丫 提交于 2019-11-30 17:31:25
问题 Morning all, How would I go about getting the serial number of the storage/sd card on my mobile device? I am using C#.Net 2.0 on the Compact Framework V2.0. Thanks. 回答1: The Smart Device Framework provides a mechanism to get SD Card serial numbers and manufacturer IDs. 回答2: I'm not on a machine that I can get the syntax for you but I believe you can use the System.IO namespace to get IO based attributes. First get a DirectoryInfo to the storage card. (I'm not 100% on the code here, you may

How to get the parameters passed to the asynchronous method in the callback

霸气de小男生 提交于 2019-11-30 09:56:54
问题 I need a Label that is transmitted to the AsyncSendRegistrationMethod in CallbackMethodSendRegistration. private delegate ResponceFromServer AsyncSendRegistrationDelegate(RegistrationToUser registrationToUser, Label label); private ResponceFromServer AsyncSendRegistrationMethod(RegistrationToUser registrationToUser, Label label) { SetText(label, registrationToUser.Name + " registration..."); return Requests.DataBase.Authorization.Registration( registrationToUser.Name, registrationToUser

Is C# 4.0 backward compatible to C# 2.0?

痞子三分冷 提交于 2019-11-30 09:24:57
May I know what is the difference between C# 4.0 and C# 2.0? Is C# 4.0 backward compatible to C# 2.0? Can I say that C# 4.0 is a superset of C# 2.0 (just like what C++ is to C)? Thanks. Mark Byers C# 4.0 is nearly backwards compatible with previous versions but there are a few breaking changes . For most ordinary code you won't notice these breaking changes. For the new features in C# 4 you can check out the Wikipedia article which has quite a good summary with examples. The key points are: Dynamic member lookup Covariant and contravariant generic type parameters Optional ref keyword when

How to load local HTML pages in WebBrowser control in C#

与世无争的帅哥 提交于 2019-11-30 08:37:35
问题 I have number of local HTML pages. I want to display these local HTML pages in Web browser control. When I add new page it should get append to previous page. Here is the sample code for the setting Url for( int i=0; i<=filecount; i++) web-browser.Url = new Uri(filepath[i]); But during run time its showing the File Download pop up and web browser is empty. 回答1: You could load a single page as FileStream source = new FileStream(filepath, FileMode.Open, FileAccess.Read); webBrowser1

Server.Transfer throws Error executing child request. How to resolve?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 07:46:19
问题 I have a HttpModule in C# 2.0 which handles exceptions thrown. Whenever the exception is thrown, an error page (aspx) with some querystring will be called. It is done through Server.Transfer() . But when the control tries to execute Server.Transfer() , the following exception is thrown: Error executing child request for [pagename].aspx. Whereas Request.Redirect() works fine. I tried setting EnableViewStateMac="false" in Page directive of the page to which request is transferred. Still problem