|
Please show me how to call ExitWindowsEx function in user32.dll in .NET.I've tried this:
[DllImport("user32.dll")]
private static extern int ExitWindowsEx(int dwReserved, int uReturnCode );
public static void Main()
{
ExitWindowsEx(0,0)
}
This previous code can log off the computer but when i change it to ExitWindowsEx(1,0) nothing happen.i dont understand clearly about these parameters's meanings.So please explain more clearly for me.Tnx lots
|
|
|
|
|
|
Hi there,
While you want to get help from CodeProject, but your username can make people here really annoyed, it's not polite (or do you think people don't know Vietnamese?)
|
|
|
|
|
minhpc_bk wrote: (or do you think people don't know Vietnamese?)
Regards,
Nish
|
|
|
|
|
Hi Nish,
You probably get shocked when you know what his id means in English. It's currently in Vnese, and in English it means "f*ck your mom" ! However, I think he might be joking when he picked up this id for himself.
|
|
|
|
|
HI all.I'm really sorry.I dont mean that because i'm not vnese and i dont understand its meaning.I've changed it already.However pls help me with this problem
|
|
|
|
|
|
minhpc_bk wrote: You probably get shocked when you know what his id means in English. It's currently in Vnese, and in English it means "f*ck your mom" ! However, I think he might be joking when he picked up this id for himself.
Egad! That is bad!!!
Regards,
Nish
|
|
|
|
|
Hi everybody!!!
I have a DataSet with only one DataTable in it.
The DataTable has many DataColumn and one of those is binded to a ComboBox.
Below the DataColumn...
DataColumn protocolloColumn = new DataColumn("protocollo");
protocolloColumn.DataType = System.Type.GetType("System.String");
carDataTable.Columns.Add(protocolloColumn);
...and the Binding
this.protocolloComboBox.DataBindings.Add(new Binding("SelectedValue", carDataSet, "car_models.protocollo"));
The ComboBox is populated with some string.
When I select a value from the combobox, this value is not stored in the dataset.
Can anybody help me?
|
|
|
|
|
Ive built an client/server application where several clients are sending live data about itself to the server. Everything is working well on the local network using MSMQ. Im using private queues since i dont need any ack or transactions. The problem is i want everything online. So i changed the formatname to http and used the built in http support in msmq. This actually worked fine when i tried with a computer not behind a firewall or a router (win xp). But when trying to connect to a computer withtin a router (win2k3) it doesnt work. The message stays in the outgoing queue on the client. Ive set all the permissions and the port is of course open (i can enter the ip + /MSMQ/ and wont get an error).
Anyone know what could be wrong?
Or, if anyone have another idea how to do this it would be appreciated. Also, what i really want to do is to be able to recieve messages over http (instead of only beeing able to send them). Because as it is now, i can only put the message trough http, but must recieve them trough the local network using another format name. Please help
/Andreas Ö
|
|
|
|
|
I'm trying display timestamps using the following format 20060109 152412Z (year month day hour minute second Z = zulu/gmt time). The closest I've got is to set the System.Globalization.CultureInfo.DateTimeFormat.FullDateTimePattern to "yyyyMMdd HHmmss" which does everything except the timezone change. In addition to not knowing how do to the timezone thing, convert.ToDateTime() won't parse strings in this format.
|
|
|
|
|
Create a DateTimeFormat object and set the custom format on that, then you can use it to format and parse strings.
For time zone convertsion, look into the TimeZone class.
---
b { font-weight: normal; }
|
|
|
|
|
I am. My main form constructor calls this code:
<br />
System.Globalization.CultureInfo info;<br />
info = System.Globalization.CultureInfo.CurrentCulture;<br />
info = new System.Globalization.CultureInfo(info.LCID, true);<br />
info.DateTimeFormat.ShortTimePattern = "HHmmss";
info.DateTimeFormat.LongTimePattern = "HHmmss";
info.DateTimeFormat.ShortDatePattern = "yyyyMMdd";
info.DateTimeFormat.FullDateTimePattern = "yyyyMMdd HHmmss";
System.Threading.Thread.CurrentThread.CurrentCulture = info; <br />
<br />
DateTime test = Convert.ToDateTime("20060109 170501");<br />
The converions call on the last line throws a System.FormatException: {"String was not recognized as a valid DateTime." }
|
|
|
|
|
Odd, I really thought that would work. Perhaps it's the tricky date format.
You can use ParseExact:
DateTime test = DateTime.ParseExact("20060109 170501", "yyyyMMdd HHmmss", null);
---
b { font-weight: normal; }
|
|
|
|
|
That way worked. I'm going to kick the convert problem over to the MSbug tracker and see what they say. I can't see any way they could call this behavior a 'feature', then again Ctrl key shortcuts working for invisible menu items apparently are, and weren't changable because it might break intended functionality in an existing app. Anyone intentially using that behavior deserves to have more than just thier app broken, IMO.
|
|
|
|
|
Guffa wrote: For time zone convertsion, look into the TimeZone class.
That looks like it covers most of what I want, there doesn't appear to be a way to set the app to always read/write/display in a TZ other than the system default. The number of places where I'm using date/times is small enough that it's not a prohibitive change to hardcode them seperately, but I prefer not to do so whenever possible.
|
|
|
|
|
I need writing to COM port (COM1 for example) to send AT commands to modem, please help me doing that. I heared, that i can open COM as a file and write into it, but when i tryed this in C# - an error occured: "FileStream will not open Win32 devices such as disk partitions and tape drives".
Help me please.
Thanks.
SAns
|
|
|
|
|
Use the SerialPort[^] class.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
|
Thanks, I'm allready solve this problem: I used "http://www.gotdotnet.com/Community/UserSamples/Download.aspx?SampleGuid=FCBA7FC5-666E-4EB0-863F-0045B0C79EC7" SerialStream Class, but I'll see your classes too.
SAns
|
|
|
|
|
hi,
I am trying to display status of the application using ToolStripStatusLabel.
it works fine but the problem is if the status message is longer than the length of the label itself then it does not display the status message info.
will really appreciate your help.
rnv
|
|
|
|
|
Hi,
I have a class library in C#.This dll will reside on mobile or PDA device.
the device will be connected to PC using active sync.I want to call functions inside this DLL from client running on PC.Is there any way to achive this ,since class library doesn't export any functions?
|
|
|
|
|
Features not supported in .Net Compact Framework
Being a subset of .Net Framework, not all features are supported by .Net Compact Framework. Following are some key features that are missing in compact framework.
[Reference 2]
1. ASP .Net: Primarily being a rich client platform, it doesn’t provide any ASP .Net support.
2. Assemblies and GAC: There is no support for multimodule assemblies.
3. COM Interoperability: Even though interoperability with COM objects is not supported, there are other ways of accessing a COM object. Platform Invoke method can be used to call native DLLs which in turn can access COM DLLs.
4. Asynchronous Delegates: Not supported.
5. Reflection: No support for System.Reflection.Emit namespace.
6. XML Web Services: Developers cannot host web services under .Net Compact Framework.
7. Remoting: Cannot develop Remoting applications.
8. Printing: No support for printing functionalities.
9. GDI+: Advance GDI support is missing in Compact Framework.
10. XML: XML Schema validations and XPath are not supported.
Taken from:
http://www.c-sharpcorner.com/Code/2004/June/DevelopCFApps.asp [^]
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.
-- modified at 9:49 Monday 9th January, 2006
|
|
|
|
|
my dataTable has columns ID and Name
in my datagrid i have hidden Column Id and only display Column Name
code in C#
table.Columns["Id"].ColumnMapping =MappingType.Hidden;
datagrid.DataSource =table;
how can i access my Column id
i have tried
DataTable tb =(DataTable)DataGrid.DataSource;
DataRow row =dt.Rows[0];
decimal id =(decimal)row[1].ToString();
olny get errors
thanks
regards paula
|
|
|
|
|
This is because row[1].ToString(); return a string which cannot be cast to decimal . If the column is of type decimal then try decimal id =(decimal)row[1]; or even better (as it works with any numerical values) decimal id =Convert.ToDecimal(row[1]);
And in future please post the error message you get (and exactly where it occurs).
|
|
|
|