I just want to share this with you. There's people who loves writing software in notepad, i'm one of them. Programming with notepad can get you a big headache but in my opinion is more flexible in terms of custom components (custom editor, custom compiler, custom resource creator) and is very handy at compile time, using batch files (.bat) is the most common option for compilation when notepad is used instead an IDE.
C# programmers are going to love this notepad replacement. So i posted this message in the .Net Framework and here.
I just found an incredible Opensource text editor for us: Notepad++
You can download an executable with installer and a zipped version for people who likes "clean" apps.
It's not a resource hungry app, it's a notepad with syntax highlighting (many languages) and format encoding, and no additional features such as code completion, and others. It's a real tool for real brainy programmers.
trying to understand
StateObject param in BeginRecieve.
any info about it would be greatly appreciated.
It popups in MS documentation as if
it is something obvious and needs no
it appears that StateObject is mapped to
OVERLAPPED structure in win32 api, it is possible
to relate offsethigh and offsetlow to stateobject's fields but
what happens to StateObject once it gets inside
BeginRecieve and what changes happen to it ?
also why in MS sample StateObject has Socket type
It's just a convenient place holder for something that you want to pass to the callback function. Whatever is passed in the state object can be retrieved inside the callback using the IAsyncResult.AsyncState property. For example
string test = "Senthil rocks";
s2.BeginReceive(so2.buffer, 0, StateObject.BUFFER_SIZE,0,
new AsyncCallback(Async_Send_Receive.Read_Callback), test);
void Async_Send_Receive.Read_Callback(IAsyncResult result)
string s = (string)result.AsyncState; // will be "Senthil Rocks"
You'll usually pass something more useful, such as the socket object on which you will call EndReceive.
If your socket object is a class level member variable, then yes, there's no need to pass it as in the state parameter.
Having it as a local variable gives a very minor advantage, the GC will be able to collect the socket object quicker, as there will be no outstanding references once the callback completes. Having it as a member variable means that the reference will be valid till the parent class is alive.
Not worth making it as a local variable just for that though.
/// Summary description for Class1.
/// The main entry point for the application.
static void Main(string args)
Console.WriteLine("Enter the value of N");
int nFact = 1;
int nComputeTo =int.Parse(Console.ReadLine());
int nCurDig = 1;
for (nCurDig=1;nCurDig <= nComputeTo; nCurDig++)
nFact *= nCurDig;
Console.WriteLine("n! = "+nFact+"\n");
//calculate (n-k) !
Console.WriteLine("Enter the value of K");
int nFact1 = 1;
int nCurDig1 = 1;
for (nCurDig1=1;nCurDig1 <= nComputeTo1; nCurDig1++)
nFact1 *= nCurDig1;
privatevoid open_Database(string XML_DB_Name)<br />
DataTable dt = dataSet.Tables;<br />
string tblName = dt.TableName;<br />
currentTable = dataSet.Tables[tblName];<br />
dataGrid1.SetDataBinding(dataSet, tblName);<br />
dataGrid1.CaptionText = tblName;<br />
DataRow MyRow = currentTable.Rows; <---- Problem when currentTable is empty, i get an exception...probably i can get the RowCount in another way?<br />
int RowCount = MyRow.Table.Rows.Count;<br />
// By default there is no DataGridTableStyle object.<br />// Add all DataSet table's style to the DataGrid<br />foreach(DataTable dTable in dataSet.Tables)<br />
DataGridTableStyle dgStyle = new DataGridTableStyle();<br />
dgStyle.MappingName = dTable.TableName;<br />
if(RowCount < 8)<br />
dgStyle.PreferredColumnWidth = 120;<br />
dgStyle.PreferredColumnWidth = 110;<br />
i get this exception:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll
Additional information: There is no row at position 0.
But i want to have the rowcount also when its 0!!
I have a file that has a serialized object in it.
I wrote ANOTHER program that I wanted to read that object.
When I attempt to Deserialize I get the following execption:
Unable to find assemble 'Address, Version 188.8.131.52, Culture=neutral, PublicKeyToken=null
To make sure the second program new about the class object that was stored in the file, I copied the class to the new program. I also copied the Serialize and Deserialize code that works on the first program to the second program. The first program can read and write with no problems to this file. Both programs were created in MS's Visual C# 2005 Express Edition Beta.
Anybody have an idea why one program can not read a serialized file created by another program?
That still wont work. According to MSDN, a serialized stream will NOT deserialize in any program except the one that serialized it. Maybe of your new program has the same assembly name and such it may work.
I searched for days for this answer until I came scross that on MSDN.
Does anyone know how to make DebugView from SysInternals "work"? I am trying to write a C# program in .NET 2003 and to print 2 lines:
System.Diagnostics.Debug.WriteLine("I am debugging");
System.Diagnostics.Trace.WriteLine("I am Tracing");
I start dbgview.exe, run my program, and I do not see those comments (I checked that I am in debug mode). I have seen references to some kind of TraceListener, but I don't know what that is or where to set it up.
If anyone knows what I'm talking about, could you please link me to some pertinent info? My quick search on google didn't give me anything.
Last Visit: 31-Dec-99 18:00 Last Update: 25-May-22 0:45