|
Green Fuze wrote: as we all know C#, like java, is a reference based language.
Except for value types. e.g. DateTime
|
|
|
|
|
Arrays *are* contiguous in C# (or even Java, for that matter). The fact that they are reference types doesn't mean a linked list like implementation.
|
|
|
|
|
I understand it is an array in the memory (although it is reference, and not a linked list), what I wanted to know how can I "disable" this reference, and create 2 objects in the memory, one after another.
|
|
|
|
|
Try working with pointers in unsafe { } blocks. That gives you the functionality as it is implemented in C++
WM.
What about weapons of mass-construction?
|
|
|
|
|
Thanks
|
|
|
|
|
I have come across something that I can only describe as the strangest bug I have ever encountered whilst working with the .NET Framework.
I have the following code:
static void Main(string[] args)
{
string localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
string rsaSessionPath = @"Microsoft\Crypto\RSA\S-1-5-18\";
string fullPath = Path.Combine(localAppDataPath, rsaSessionPath);
DirectoryInfo di = new DirectoryInfo(fullPath);
FileInfo[] rsaSessionFiles = di.GetFiles();
foreach (FileInfo rsaSessionFile in rsaSessionFiles)
{
if (rsaSessionFile.CreationTime < DateTime.Now.AddDays(-3))
{
rsaSessionFile.Delete();
}
}
}
As you can see this is a very simple piece of code that retrieves all files within a specific directory and then deletes all the files aged 3 days old and over.
Now this application works exactly as I would expect it to, however I have found an interesting side effect of execution.
The server this application runs on, has various user with varying degrees of permissions. One of these user accounts (with admin privs) is used to execute various windows scheduled tasks. When I execute the application, the user on the scheduled task changes to the Administrator account, however the password is left as the password for the original account. Therefore the scheduled task fails.
I have tested this to death and cannot find another reason, everything points to the application code above. However as you can see it doesnt go anywhere near scheduled tasks so I am at a loss to explain this.
In a crazy turn of logic I also checked that the scheduler doesnt store any information in the directory the application clears out, and this is the case. Even with the delete directory emtpy, the same problem occurs.
Can anybody shed any light on this?
-- modified at 5:41 Monday 18th September, 2006
Interestingly, I have also created another new administrator account and logged on with this, when I run the application the user on the scheduled task changes to the new account name. So it seems that it changes to whoever is logged on and executes the application
|
|
|
|
|
Good day
I am supposed to run a manifest file on msbuild to create a bootstrapper but i do not know where to access or lauch MsBuild.
Can anyone help me. Thank you in advance
Kulile --- RSA
|
|
|
|
|
Good day
I am supposed to run a manifest file on msbuild to create a bootstrapper but i do not know where to access or lauch MsBuild.
Can anyone help me. Thank you in advance
Kulile --- RSA
|
|
|
|
|
I have been reading several articles on the web about datagrids in Visual Studio 2003. Everything seems to be quoting web applications, not windows applications.
The following is for a Windows Application NOT Web App
I have 7 text boxes as a header, on exit of the 6th or 7th box, if the record exists I wish to copy the information from the text boxes to the grid below. I have worked out how to build the grid but am now struggling to accomplish the remaining task
Can anyone please help me using C#, how to copy the info from a text box to a datagrid.
Someone suggested using a container but this meant nothing to me, any assistance would be much appreciated
|
|
|
|
|
if the data source of the grid is dataset , then add any row to the
associated datatable
Tamimi - Code
|
|
|
|
|
How do you add a row to the datagrid, this is what we are struggling with
|
|
|
|
|
i don't think that you can a row to a grid without adding the row
to the datasource.
so what ?? what is the data source
Tamimi - Code
|
|
|
|
|
assuming: DataGrid dg, DataTable dt
DataRow newRow = dt.NewRow();
newRow["column1"] = value1;
newRow["column2"] = value2;
...
dt.Rows.Add(newRow);
Hope this is correct and hope it helps.
I've recently started to use C# to connect to SQL server -- so have been trying to learn all these methods of adding, updating, etc. Also, it appears to me that the Windows.Forms class DataGrid certainly was not given the attention that the web class DataGrid was. I'm finding several features that could be improved.
Also, if you're "struggling" with the above, I found the following book helpful for me -"Mastering C# Database Programming" by Jason Price. Some reviews were not so kind, but it has been very helpful and very clear for me.
Good luck!
John
|
|
|
|
|
Sorry... didn't finish the code from above.
after adding the newRow to the DataTable (dt), you need to add the following to update the DataGrid (dg):
dg.DataSource = dt;
John
|
|
|
|
|
--------------------------------------------------------------------------------
Can someone help me in making a barcode checking in C programming language? The barcode is using EAN-13 code, which was normally grouped as 1-6-6. The code should check code like 9 300605 013278, and print out a message whether it's a valid barcode.
The requirement for a valid barcode is that:
• Add up all the even-numbered digits, and multiply the sum by 3:
3 + 0 + 0 + 0 + 3 + 7 = 13; 13 * 3 = 39
• Add up all the odd-numbered digits (including the check digit):
9 + 0 + 6 + 5 + 1 + 2 + 8 = 31
• Add up the two totals; the result should be divisible by 10:
39 + 31 = 70
Thanks and cheers for the help!!
|
|
|
|
|
llyod wrote: in C programming language
Wrong forum.
By the way the problem you present requires only simple mathematics and it shouldn't be that hard to code this by yourself.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Hi
I would like to create windows service for an application in c#.Basically, I have done like this. I make a function to send mail, function name sendMail () in class1.
Now, I have added one project WindowsService1 in existing application. In a WindowsService1 project,
I have written code on start() event in service1.cs. Just I made an object of calss1 and call the function SendMail. Service is successfully installed but not starts.
I am trying to start service but unable to start service. One message is displayed like this
“The Mailer service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service”.
Actually, I have some queries regarding windows service.
1) Can I call any function on OnStart () event in Windows service project.
2) How to mange windows service OnStart () event and OnStop () Event?
Any help is appreciated
Regards,
Rajesh
rajesh
|
|
|
|
|
i want to set mediaplayer start my sound at specific position,
there is this code :
axWindowsMediaPlayer1.Ctlcontrols.currentPosition
but it is readonly , and i couldnt set it !!!
|
|
|
|
|
I found it myself , it was easy , just with using following code:
axWindowsMediaPlayer1.Ctlcontrols.currentPosition = 90;
90 is 1:30
|
|
|
|
|
I want to show the log file to the user. the file size could be approximately 100 kb and the file can have hundreds of lines in it. What are the possible ways to show that file to the user by highlighting the lines having 'Error...' in it. I also want to do it efficiently so that the parsing can't affect the speed of the application.
sAqIb
|
|
|
|
|
I think your best bet would be creating a simple form with a RichTextBox inside. There should be many code examples, tutorials and/or articles in the internet that cover syntax highlighting with RichTextBox.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
dear programers
in sqlservr database i made field type 'nvarchar' and 'ntext' does not work.
how can i Encode and Decode the utf-8 characters so that i can easly save to database
sikandar
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
If you have a text saved as UTF-8, you can load it with a StreamReader using the Encoding.UTF8 encoding. When you read a string from the stream it will be decoded to Uncode, that you can store in the database.
---
b { font-weight: normal; }
|
|
|
|
|
HI
i am new in c#
plz tell me
how to define the below in c#
struct link
{
int info;
link *next
};
struct link *start=new link;
Parshant
|
|
|
|