|
if Delphi we can check the windows versions like here:
{$IFDEF WIN32}
...
{$ELSE}
...
{$ENDIF}
In c# have some directives for know the .Net version (1.0, 1.1, 2.0)???
|
|
|
|
|
Enviroment.Version property.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
|
I want to write a program like 007 spyware that monitor for all key press, even when other program has focus.
Can somebody help me?
|
|
|
|
|
|
|
I just search the Platform SDK include dir for the symbol in question. Those are the official definitions, after all. winuser.h has this line:
#define RT_RCDATA MAKEINTRESOURCE(10) so it's 10. I don't know how you'd do this without the C header files though.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Thanks for that, maybe i'll download the SDK
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
Hi...
I want to get a info about the logical drives on the computer...
My code looks like this..
private void logiskdrev()
{
string[] Drives = Directory.GetLogicalDrives();
foreach(string drive in Drives)
{
MessageBox.Show(drive.ToString());
}
}
but that only gives me the name/path (ex. "c:\", "i:\")
Can anyone tell/show me how to get info about the type! (like if it is a hdd, cd-drive or flashdisk)
And...
If you could tell/show me how to get the name too? (I have a drive called windows (c:\)) how can i get the name of the drive??
Thanks
QzRz
|
|
|
|
|
Hi!
You can get more information about your volumes by using WMI.
The class is Win32_LogicalDisk and it holds information on the type of drive, its filesystem or label: Win32_LogicalDisk on MSDN[^].
Regrads,
mav
|
|
|
|
|
it's written thats its only supported in windows 2003..
how do you do this in XP ?
|
|
|
|
|
Ooops, I've used the wrong link for the right class .
The class is, in fact, Win32_LogicalDisk and not Win32_Volume.
Win32_LogicalDisk should work on all systems.
Here's the correct link: Win32_LogicalDisk[^]
mav
|
|
|
|
|
Hi,
Suppose i have a list of all active applications in my system and every
application is a window using GetWindow() from the API. I can get their handles, the tittle af the applications, get the All children of any window of this application.I mean.. if this window is open, I'd get the handel of Address bare(because we can regard it children), and access to the content that is " www.msn.com ".
Now i want to Know how i can to do all this task by classes in C#
your help is greatly appreciated
|
|
|
|
|
So, you want to get the the handle to a window and all it's chrildren?
If so, there is a really good example on www.pinvoke.net, look up FindWindow and then FindWindowEx.
/\ |_ E X E GG
|
|
|
|
|
I'm working on a simple app for sending text messages through SMS.ac, but I need to know how to do a HTTP POST request, or more specifically, how to add the data to the request. It's encoding type is "multipart/form-data" all I need to add (I think) is the phone number and the message. Check it out at http://sms.ac/
So what would I need to do to get the correct data in the request?
|
|
|
|
|
Look into the Method property of the WebRequest class.
Somehting like this WebRequest.Method="POST";
/\ |_ E X E GG
|
|
|
|
|
I've made this code:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://sms.ac/login.asp");<br />
request.Method = "POST";<br />
Stream reqStream = request.GetRequestStream();<br />
<br />
byte[] buffer = Chars2Bytes(("loginuserid=<removed>&loginpassword=<removed>").ToCharArray());<br />
reqStream.Write(buffer, buffer.Length, 0);<br />
<br />
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
But it keeps getting timeout when I get the response...the page exists, and if the data is wrong it sohuld return something since it's running on a .NET server so any errors would still get returned wouldn't they?
Tell me if I'm doing anything stupid
|
|
|
|
|
|
|
Hi there,
I am developing a C# application in which I would like to generate buttons/textboxes or whatever controls dynamically at runtime,The number of the controls to be generated will be determined in runtime..Do anyone have any idea can I do this..How can I generate them and then further access them to manipulate them???
Pleaaaaaaaaaaaaaaaaaaaaaaase HEEEEEEEEEEEEEEEEEEEEEEEEEEELP
Best Regards,
E.A.
|
|
|
|
|
I created the below code in VB.NET a while back. It will create as many textboxes as specified in 'mintLenCode' I used the "VB.Net to C# Converstion" program from www.vbconversions.com to do a quick port to C# (getting a lazy). Mind you I'm a newbie, so take it as it is. There might be a better way.
private void CreateTextBoxes ()
{
//Declare variables for textbox properties
System.Drawing.Font Font = new System.Drawing.Font("Comic Sans MS", (float) (26.25), System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
int counter = 0;
int locationX = 16;
//Size array based on length of mlng_CODE
TxtBox = new TextBox[mintLenCode + 1];
//Create TextBoxes and set properties
do
{
counter = counter + 1;
TxtBox[counter] = new TextBox();
TxtBox[counter].Anchor = AnchorStyles.None;
TxtBox[counter].Font = Font;
TxtBox[counter].Location = new System.Drawing.Point(locationX, 152);
TxtBox[counter].MaxLength = 1;
TxtBox[counter].Size = new System.Drawing.Size(36, 56);
TxtBox[counter].TabIndex = counter;
TxtBox[counter].TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
TxtBox[counter].Name = System.Convert.ToString(counter);
locationX = locationX + TxtBox[counter].Width;
TxtBox[counter].KeyUp += new System.Windows.Forms.KeyEventHandler (txtbox_KeyUp);
this.Controls.Add(TxtBox[counter]);
} while (!(counter == mintLenCode));
}
www.lovethosetrains.com
|
|
|
|
|
Hi there,
Thanks alot for your help..But the problem now is that ,when I create buttons whose location are outside the form size, I can see them..what would be the solution to that???
I don't want to resize the windows form as its size can exceed my monitor size,but I would rather prefer a scroll bar..
Any Idea how can I solve that??
Best Regards,
E.A.
|
|
|
|
|
Hi,
I've a datagrid connected to one table from postgres database. I'm using ODBC. Also, table has only 3 columns, out of which I'm using only 2 columns, and I'mve added these columns to datagrid manually.
Now, when I try to edit ot even try to add new row after postback it doesnt seem to work! The form doesnt do anything.
There is another form where I'm creating and populating (basically handling everything at runtime) and there the same piece of code is working just fine!
Here is the code of the form that is not working...
<--CODE-ASPX-START-->
<asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 38px; POSITION: absolute; TOP: 17px" runat="server" autogeneratecolumns="False" bordercolor="Silver" borderwidth="1px">
<columns>
<asp:buttoncolumn text="Add" buttontype="PushButton" headertext="New" commandname="AddNewRow">
<asp:editcommandcolumn buttontype="PushButton" updatetext="Update" headertext="Change" canceltext="Cancel" edittext="Edit">
<asp:boundcolumn datafield="url_name" headertext="Url Name">
<asp:boundcolumn datafield="url_comments" headertext="Comments">
<asp:linkbutton id="LinkButton2" style="Z-INDEX: 106; LEFT: 208px; POSITION: absolute; TOP: 312px" runat="server" forecolor="Black" font-names="Verdana" font-size="10pt">Make Changes
<asp:linkbutton id="LinkButton1" runat="server" style="Z-INDEX: 107; LEFT: 100px; POSITION: absolute; TOP: 311px" forecolor="Black" font-names="Verdana" font-size="10pt">Add New
<--CODE-ASPX-END-->
<--CODE-ASPX.CS-START-->
private void Page_Load(object sender, System.EventArgs e)
{
string connectionStr = "DRIVER={PostgreSQL}; SERVER=localhost;UID=xxx;PASSWORD=xxx;Trusted_connection=false;DATABASE=marketing;";
string str = "select pk_url,url_name,url_comments FROM urls;";
connection = new OdbcConnection(connectionStr);
connection.Open();
selectCommand = new OdbcCommand(str,connection);
adapter = new OdbcDataAdapter(selectCommand);
ds = new DataSet();
adapter.Fill(ds,"urls");
DataGrid1.DataSource = ds;
DataGrid1.DataMember = "urls";
DataGrid1.DataBind();
connection.Close();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.DataGrid1.ItemCreated += new System.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid1_ItemCreated);
this.DataGrid1.SelectedIndexChanged += new System.EventHandler(this.DataGrid1_SelectedIndexChanged);
this.LinkButton2.Click += new System.EventHandler(this.LinkButton2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
Response.Write("Am I Editing!!!");
Response.Write(" e.item.itemindex: "+e.Item.ItemIndex);
DataGrid1.EditItemIndex = e.Item.ItemIndex;
DataGrid1.DataBind();
}
private void AddNewRow()
{
DataRow dr = ds.Tables[0].NewRow();
int loc = ds.Tables["urls"].Rows.Count;
ds.Tables["urls"].Rows.InsertAt(dr,loc);
ds.AcceptChanges();
DataGrid1.DataBind();
DataGrid1.EditItemIndex = loc;
}
private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.DataGrid1.SelectedItem.Attributes["onmouseover"] = "this.style.cursor='hand'";
this.DataGrid1.SelectedItem.Attributes.Remove("onmouseout");
if(this.DataGrid1.EditItemIndex >= 0)
{
this.DataGrid1.EditItemIndex = -1;
this.DataGrid1.DataBind();
}
}
private void LinkButton2_Click(object sender, System.EventArgs e)
{
this.DataGrid1.EditItemIndex = this.DataGrid1.SelectedIndex;
this.DataGrid1.DataBind();
}
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) | (e.Item.ItemType == ListItemType.AlternatingItem) | (e.Item.ItemType == ListItemType.SelectedItem))
{
e.Item.Attributes.Add("onmouseover","this.style.backgroundColor = 'thistle';this.style.cursor='hand'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor = 'gray'");
e.Item.Attributes.Add("onclick",GetPostBackEventReference(e.Item));
e.Item.Attributes.Add("onclick","javascript:__doPostBack(\'" + "DataGrid1:" + "_ctl" + (e.Item.ItemIndex+2) + ":_ctl0\',\' \')");
}
}
}
}
<--CODE-ASPX.CD-END-->
One more thing, as you can see I've tried adding buttonColumns in datagrid as well as withought those. But nothing seem to work!
Any, as in any suggestion is apprecitated
thanks
shatru2k
|
|
|
|
|
im also playing with postgres odbc, but not working. have you found where is the problem??
|
|
|
|
|
Hi all,
I want to check the availability of some terminals whose ip I know previously or in other words are they online or not. I send them some test message and they should in return send the affirmative answer if they are online.I assume a server is running at each end which responds to the test message.I can do it between 2 terminals in udp(dont want to use tcp for this). But how to send the message to 4 different terminals. Because in this case I cant use the single socket that i used in case of 2 terminals.I am new to networking. So dont have much idea.Should I use multithreading or something like making multiple sockets but then the question comes how many .If I am wrong somewhere please let me know.
with thanks.....
|
|
|
|