|
does the object locked get unlocked? Is there some "guidance" on that in MSDN or somewhere?
Marc
Pensieve
Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson
-- modified at 13:25 Saturday 10th June, 2006
|
|
|
|
|
Marc Clifton wrote: does the object locked get unlocked?
I'm almost certain this is true, which is why using lock() is preferred over manually locking an object (and unlocking it in a finally clause).
[edit]
See this[^] MSDN article.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
What is the format of the data you are trying to parse?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
The format is yyyyMMdd
|
|
|
|
|
Are you sure that it's the parsing part of the code that is not working?
The expression in the Select call doen't really look like it should work. The value you are comparing the date field with is either a string or a date, but there are no apostrophes or # characters around the value.
---
b { font-weight: normal; }
|
|
|
|
|
Exaclty the way that you have done it. I tested it and it works perfectly.
Read my previus post again.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Found the problem. I had white spaces like this:
<Date> 20060204 </Date>
Changed it to this:
<Date>20060204</Date>
Thanks for your help!
|
|
|
|
|
hello everybody in this forum.
first of all , i would like to thank every programmer that helped me in the last few problems i faced , Really i respect all of you in this great website for programmer to programmer experience sharing.
i face one problem in connection . every body knows that i can't connect to a user connected through DSL or broadband connection users cause their Private network is mapped by a NAT Router that Connects them to the outside world. That is fine
but i would like to connect to any user on the world wide web for these reasons i successfully programmed the following
-------------------
1)i succeeded to add my application to Windows Firewall programmatically to the exception list.
2)i added my application port that the messenger will listen on and receieve incoming packets from the outside world in SERVICES programmatically .
Services options are found in your current connection Settings under
Go to your control panel - > Network connections - >current connection -- > properties ->advanced -> Settings -> Advanced Tab -> Select your current connection -> and press settings - >this is where i added my application successfully once it runs programmatically through Hnetcfg.dll in system32 but the problem still exists
The problem is that my friends on DSL or broadband connection that have my application running , i can't connect to them directly even when i had their router ip address and my application also had successfully added itself in the above settings.
----------------------------------------------
I read in MSDN that there is NAT TRaversal . and they expose alot of interfaces like INATupnp , IStaticPortMappings and others interfaces which are existed in hnetcfg.dll but when i add that file to my application i don't find those interfaces.
Note:
------
i was on winxp sp1 and then installed winxp sp2 and also i didn't find those interfaces .
So any one can help me to make the router for Lan Users know how to deliver packets to their specified computers in Lan from the outside world ?
Please i want to reduce the traffic and bandwidth from the server itself by direct connection.
Human knowledge belongs to the world.
|
|
|
|
|
I have this method in a vb6 dll that i want to use from c# code
===================================================
Declare Function ProcessData Lib "xyz.dll" (ByVal sOut As String, ByVal nOutLen As Integer, ByVal sIn As String, nInLen As Integer, ByVal LowResolution As Integer) As Integer
===================================================
my import code is as following:
===================================================
[DllImport ("xyz.dll",
EntryPoint="ProcessData",
ExactSpelling=false,
SetLastError=true)]
[return:MarshalAs(UnmanagedType.I4)]
protected static extern Int32 ProcessData(
[MarshalAs(UnmanagedType.LPStr)] string sOut,
[MarshalAs(UnmanagedType.LPArray)] Int32[] nOutLen,
[MarshalAs(UnmanagedType.LPStr)] string sIn,
[MarshalAs(UnmanagedType.LPArray)] Int32[] nInLen,
[MarshalAs(UnmanagedType.LPArray)] Int32[] LowResolution);
===================================================
it is always returning unexpected results. I do not know what is the problem. could you plz help?
|
|
|
|
|
Hi guys!
I am a newbie to this language and I request your help. I have a text file called confirm.ini which I am trying to parse it and then load different data in the file into different text boxes.
Here is how my confirm.ini file looks like:
Directory Containing Source Files for Processing: C:\text\Users\
Directory to Archive Processed Files: C:\text\Archive\
----------------------------------------------------------
Configuration:
Users: WWWW
Accounts: 3fffffff
AR: 212222
AD: 232313
Participants:
Amount: 23
Fee: 4444444
-------------------------------------------------------------
Basically I need to load each fields above, i.e. Users value "WWWW" into Users.text and then Accounts value into Accounts.text and so on. Please help, I am kind of lost in this matter.
I appreciate your help in advance.
sasa
|
|
|
|
|
you can read ur file into a string variable ( ex: text) and use follow methods or properties:
<br />
string find;<br />
find=text.Substring(int_start_index,int_length);<br />
find=text.Replace(old_value,recently_value);<br />
and ....<br />
<br />
note : use using System.IO; for working with files.
|
|
|
|
|
Thank you Nafiseh, I appreciate your help. I will try this and post a message if it works.
sasa
|
|
|
|
|
hello,
Since I got no answer on this rather simple question on the mobile dev forum,
I'll repost my question here.
I want to build a tray application for pocket pc 2003.
Does anyone have a good example to start?
greetings,
and tanks in advance
Niko
|
|
|
|
|
How can i convert the DataGridView.SelectedRows to the either the DataRow[] or DataRowView[]. If you have some alternative solution plz tell me.
Thanks
|
|
|
|
|
how to release lock when another thread requests for the same resource, taking input form user
e.g thread1: eating
(now user inputs 2 means 2nd thread wants to eat"how to solve it")
jazzziiii
|
|
|
|
|
i use following code , but my all of my listbox items show DataRow, and display member didnt show.
note: i bind datasource of listbox on runtime.
private void li_name_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)<br />
{<br />
e.DrawBackground();<br />
<br />
Brush myBrush = Brushes.Black;<br />
long AID=0;<br />
DataRowView D_Author_name=(DataRowView)li_name.Items[counter_item];<br />
string Author_name=D_Author_name["Name"].ToString().Trim();<br />
Authors author=new Authors();<br />
AID=author.find_AuthorID(connection.make(),string_process.editition(Author_name));<br />
counter_item=counter_item+1;<br />
if(AID !=0)<br />
{<br />
myBrush = Brushes.DarkGray;<br />
}<br />
e.Graphics.DrawString(((ListBox)sender).Items[e.Index].ToString(), <br />
e.Font, myBrush,e.Bounds,StringFormat.GenericDefault);<br />
e.DrawFocusRectangle();<br />
<br />
<br />
}
<br />
public class Authors<br />
{<br />
OleDbConnection con;<br />
OleDbCommand cmd;<br />
<br />
public long find_AuthorID(string cnstring,string Author_name)<br />
{<br />
try<br />
{<br />
con=new OleDbConnection(cnstring);<br />
string cmdstr="select id from authors where name='" + Author_name.Trim() + "'" ;<br />
int id=0; <br />
cmd=new OleDbCommand(cmdstr,con);<br />
cmd.CommandType=CommandType.Text;<br />
con.Open();<br />
OleDbDataReader rd;<br />
rd=cmd.ExecuteReader();<br />
if (rd.Read())<br />
{ <br />
<br />
id=(int)rd[0];<br />
con.Close();<br />
<br />
return id;<br />
<br />
}<br />
else<br />
{<br />
con.Close();<br />
return 0;<br />
<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
return -1;<br />
<br />
}<br />
}<br />
}<br />
|
|
|
|
|
nafiseh_salmani wrote: e.Graphics.DrawString(((ListBox)sender).Items[e.Index].ToString(),
This is the problem, you're getting the ToString of the DataRow class. If you want to draw the DisplayMember then you'll need to use reflection to get the value of the property given in DisplayMember, you can then use that as the string.
If DisplayMember will always be a the value from a column of the row then you can use that as the key for the columns. I.e. cast the ListBox.Items[e.Index] to a DataRow and then retrieve the value from the columns.
So if DisplayName is the column name:
ListBox tempListBox = (ListBox)sender;
DataRow dataRow = (DataRow)tempListBox.Items[e.Index];
e.Graphics.DrawString(dataRow.Columns[tempListBox.DisplayMember].Value, ...); I'd suggest optimising the code as well because even you're snippet has a lot of boxing and unboxing going on and if the list contains more than a few items then you're going to take some serious performance penalties.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Thanks, i did it before read your reply
but now , i have another problem with these items.
when i want to click on one of them their places change , and their text mixed together !!!!
|
|
|
|
|
I'm not sure based on your code but there'll be something wrong with the layout logic somewhere.
I did have a fantastic example from my "Programming Visual Basic .NET" book by Balena but can't find the code at the moment, take a look at the source code in this[^] article in the meantime.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hello fellows.
I am developing a PDA application is c#.I have two problems in it
1.I want to set any page as startup.so that when the application runs that page is opened.but i dont know how can i do that.
2.I want to transfer some files from my pc to pda and vice versa.how can i do that?please help me out.
Ahsan Ullah
|
|
|
|
|
how to select all table names in MSSQL 2005. i tried the select * from catquery, but it doesn´t work.
cellardoor
|
|
|
|
|
use databse<br />
select * from INFORMATION_SCHEMA.TABLES
|
|
|
|
|
|
|
I would like a short example on how to populate a comboBox with the result of an SQLcommand.
Thanks!
|
|
|
|