|
There is actually a trick on using ASP.NET applications as standalone - you would need to write a small .exe which hosts the ASP.NET Runtime. I believe the article can be found in the MSDN Magazine (not 100% sure though...)
----------------------
~hamster1
|
|
|
|
|
Hi, I need help with this. I added a xml file into my project. Now, in one class i need to acces it so i can process the data in it. How can i do this? how can i get the path of it so i can access it?
Thank u so much, i would help me a lot...
|
|
|
|
|
In order to acces a file that is in the same path with the executable you can try the Application.StartupPath property.
I hope you understand...because is a rough world out there...
|
|
|
|
|
is it a property of the project? or where can i find this property?
|
|
|
|
|
Put this into your code.
string pathToMyExe = System.Windows.Forms.Application.StartupPath;
I hope you understand...because is a rough world out there...
|
|
|
|
|
im sorry, its a asp.net project
|
|
|
|
|
use Server.MapPath to get physical path
Server.MapPath("Direcory1\filename.xml");
MCAD
-- modified at 17:40 Thursday 1st September, 2005
|
|
|
|
|
do i need to import something? using....?
|
|
|
|
|
hi, i have a datagrid with a size = 280; 216 and a PreferredColumnWidth = 120
i have 2 columns!
if i write some text in row nr 7 you can see a vertical scrollbar on the left side!
so i must set a smaller PreferredColumnWidth:
<br />
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)<br />
{<br />
if(dataGrid1.CurrentRowIndex == 7) && some text ist entered....!?<br />
{<br />
dataGrid1.PreferredColumnWidth = 20;<br />
}<br />
}<br />
but nothing change;-(
cu
|
|
|
|
|
Hello gurus,
I have a small problem of data inversion in file writing.
I wish to write the bytes of Int16 and Int32 in the same order as we read them.
Currently, when I write an Int32 for example lets say: 0xDEF40003
In the file we see: 03 00 F4 DE
I wish to write the same way as we read it: DE F4 00 03
How to do that?
Thanks for the help
Best regards.
There is no spoon.
|
|
|
|
|
That is the Intel byte order. To get the result you want, you have to use Motorola byte order.
How do you write the int to the file?
---
b { font-weight: normal; }
|
|
|
|
|
how did you guessed that it was for MC68K???
I do the following:
bw.Write(darkValues32[i]); while the content of darkValues32 is anInt32 .
There is no spoon.
|
|
|
|
|
That's wasn't a guess.
Extract the bytes from the value:
bw.Write((byte)((darkValues32[i] >> 24) & 255));<br />
bw.Write((byte)((darkValues32[i] >> 16) & 255));<br />
bw.Write((byte)((darkValues32[i] >> 8) & 255));<br />
bw.Write((byte)(darkValues32[i] & 255));
---
b { font-weight: normal; }
|
|
|
|
|
Ok, it works like a charm
Thanks a lot
There is no spoon.
|
|
|
|
|
This is a BigEndian LittleEndian problem
This means that your system writes a hexadecimal number in the right-left order or left-right...
I guarantee you that if your system writes the number in that order, when it will attempt to read the number, te result will be the correct one...
But, if you just want to format in that way your data into the file, the simplest way is to split the number into bytes, write them, spend some time, read the bytes back and build your numbers ...
I hope you understand...because is a rough world out there...
|
|
|
|
|
And how to write an Int32 or Int16 in a Big Edian format?
There is no spoon.
-- modified at 16:25 Thursday 1st September, 2005
|
|
|
|
|
Here is an example on how to split a Int32 into bytes :
UInt32 myNumber = (UInt32)0xfefdfcfb;
byte b4 = Convert.ToByte(myNumber/(65536*256));
myNumber -= ((UInt32)b4) * (65536*256);
byte b3 = Convert.ToByte(myNumber/65536);
myNumber -= ((UInt32)b3) * 65536;
byte b2 = Convert.ToByte(myNumber/256);
myNumber -= ((UInt32)b2) * 256;
byte b1 = Convert.ToByte(myNumber);
Here b1 is LSB and b2 is MSB, meaning that myNumber is 0xb4b3b2b1
I hope we understand...because is a rough world out there...
|
|
|
|
|
Not sure if it's the most efficient but anding the int with masks to extract each byte, bitwise shifting them until the desired byte is in the lower 8 bits, and converting the result into an int8 should work.
This code will extract the 3rd byte of i and assign it to b;
uint i = 0xAABBCCDD;
uint j = i & 0x00FF0000;
j = j >> 16;
byte b = (byte)j;
|
|
|
|
|
What's the most direct way to validate the text in a textbox?
If the text entered is NOT a number an "Invalid Entry" MessageBox will pop up.
How to code (more or less)? thanks....
|
|
|
|
|
The simplest way to check if a text is a number or not is to convert it :
try {
Convert.ToInt32(myTextBox.Text);
}
catch
{
MessageBox.Show("Invalid Entry", "Error!");
}
I hope you understand...because is a rough world out there...
|
|
|
|
|
I have a RichTextBox control with a vertical scroll; however, the vertical scroll is not always active depending on the height of my control.
Is there a way to figure out when the vertical scroll becomes visible on the control?
Reason I need is to calculate the number of characters per line and to do it I use method GetCharIndexFromPosition(pointAtRightCorner) and the pointAtRightCorner variable depends on whether vertical scroll is active or not.
|
|
|
|
|
Hi guys,
Does anyone know how I can capture the event when a user clicks the Minimize button on the control box in C#?
I want to issue a warning messagebox when they click on it. And why does the message box show nothing on it, even though I have set all the parameters in the messagebox function properly? There are nothing on it except an empty button with no caption.
Please help...
|
|
|
|
|
In order to catch the minimize event of an window you moust intercet the WM_SYSCOMMAND message and check that the WParam is SC_MINIMIZE. How can you do this? Simple, override the WndProc of your form :
protected override void WndProc(ref Message m)
{
if(m.Msg == 0x112)
{
if(m.WParam.ToInt32() == 0xf020)
{
return;
}
}
base.WndProc (ref m);
}
I hope you understand...because is a rough world out there...
|
|
|
|
|
Hook the Resized event of the form and then check that the WindowState is equal to FormWindowState.Minimized. If it is, issue your messagebox and do anything else that you want to.
|
|
|
|
|
(Could anyone please help me out with their expertise in writing web custom user controls. Basically i need to add around 5 custom properties to all the existing controls.
Web Content page will have a XMLDataSource set up on the page. When other controls(like textbox, dropdown, radio, label controls etc.) should have properties like DataSource, DataMember , DataTextField and DataValueField.
DataSource property should be a dropdown with the list of available datasources on the content pages(basically xmlDataSources).
DataMember property should display all the tables present in the selected XML of xmlDataSource on the web page.
Similarly DataTextField and DataValueField should display all the members under the table(selected in DataMember).
Could you please send a sample code to do this.
Thanks in advance.
Murali
Rangam
|
|
|
|