|
coz I'm here sir, like u r
--sum1
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think it's a mathematical formula.
Sum(1) = 1
As in, her IQ. As in, her percentage chance of ever writing a piece of coherent code in her life
modified on Friday, March 13, 2009 2:45 PM
|
|
|
|
|
correction
As in, her IQ. As in, her percentage chance of ever writing a piece of coherent code in her life
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Whoops. My mistake. Zapped
|
|
|
|
|
hi there! any idea how I can get the http status code of some webpage with web service? I want to input the webpage address and then get the actual http status code(200, 403,400, etc...) for return. Thanks in advance, Laziale
|
|
|
|
|
laziale wrote: hi there! any idea how I can get the http status code of some webpage with web service?
Yes. The same way you get it when you are not using a web service. For the moment I will assume you know how to do that since you are indicating that using a web service is the significant aspect of your problem.
|
|
|
|
|
well, first I want to let you know that I haven't work with this kind of problem before. here is how what I am doing so far:
WebRequest request = WebRequest.Create(webaddress);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
HttpStatusCode code = response.StatusCode;
responseString = code.ToString();
but when the code is different from OK, like Address Not Found or Forbidden I am getting this error on:
System.NullReferenceException: Object reference not set to an instance of an object.
at web_check.Service1.getStatusCode(String webaddress)
at this line:
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
I would really appreciate if you will help me. Thanks, Laziale
|
|
|
|
|
Hello,
I am relatively new to C# and have a question regarding multiple comboBox actions. I want to create a method that modifies the list in a comboBox when another comboBox is changed. For instance, when slot1Serv is changed, an action modifies the list for slot1Adp to be the 2 items that correspond to slot1Serv's selection. The issue is that i have server comboBox's to work with (12 slotXServ comboBox's and their slotXAdp).
Can I pass the comboBox that I'm working with to the method? Can I create a custom comboBox class with the action to change another box? Am I over thinking this?
Any help would be greatly appreciated. Please also let me know if you need further information.
chopper
|
|
|
|
|
Maybe something like this will give you a nudge in the right direction...
This example assumes that there are 4 comboboxes, comboBoxA1, comboBoxA2, comboBoxB1, and comboBoxB2. comboBoxA1 will modify the currently selected item in comboBoxB1, and likewise for comboBoxA2 and comboBoxB2. In putting this quick example together, each of the comboboxes have the same exact items in them. You may need to adjust to fit your situation as needed.
This example requires that you stick to some sort of naming convention for the comboboxes (which it appears you do)
public Form1()
{
InitializeComponent();
for (int i = 1; i <= 2; i++)
{
string name = string.Format("comboBoxA{0}", i);
ComboBox cbo = (ComboBox)this.Controls[name];
cbo.Tag = i.ToString();
cbo.SelectedIndexChanged += new EventHandler(this.ComboBoxA_SelectedIndexChanged);
}
}
private void ComboBoxA_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cboA = (ComboBox)sender;
string index = cboA.Tag.ToString();
ComboBox cboB = (ComboBox) this.Controls[string.Format("comboBoxB{0}", index)];
cboB.SelectedIndex = cboA.SelectedIndex;
}
|
|
|
|
|
Thanks for your help. Now when I run the code below, when it gets to the second comboBox (slot{}Adp), I get a null exception. Is the "this.Controls[]" actually referencing the original CB, or is it just loading its behavior?
private void adapterSelect(object sender, EventArgs e) {
ComboBox cbServ = (ComboBox)sender;
ComboBox cbAdp = (ComboBox)this.Controls[string.Format("slot{0}Adp", cbServ.Tag.ToString())];
cbAdp.Text = "test";
}
|
|
|
|
|
Hello
I'm using a class of about 30 different parameters
I find very easy to use the little method below to automaticaly serialize and save those parameters
Unfortunately it does not work for Font
Is there some trick to use to wrap fonts the same way ?
Or do I have to serialize ALL elements one by one manualy ?
Tanks for any help
private void SaveTemplate()
{
XmlSerializer xs;
StreamWriter sw;
string TemplateFile = "d:/tmp/xxx.xml";
if (TemplateFile.Length <= 0)
{
return;
}
xs = new XmlSerializer(typeof(C_PrintSettings));
using (sw = new StreamWriter(TemplateFile, false, Encoding.Default))
{
xs.Serialize(sw, Document.PrintSettings);
sw.Close();
}
}
|
|
|
|
|
This is a classic case of using technology that you have not studied and therefore do not understand it.
They hide that information in the documentation.
XML Serialization in the .NET Framework[^]
Q: Why can't I serialize .NET Framework classes like exceptions and fonts?
|
|
|
|
|
Thank you Mike
Indeed !
And you can also learn a lot by sharing experience !
You give me a way by pointing out some documentation usefull to read
Maybe I will also found some good tricks here or elsewhere
And this is a way to study too !
Thanks too share your knowlege !
Olivier
|
|
|
|
|
baranils wrote: You give me a way by pointing out some documentation usefull to read
Actually no. I didn't because I used Google[^] to find it. So technically Google gives you a way by pointing out some documentation useful to read. Of course that requires you to use Google rather than posting questions in internet forums so that other people can use Google for you to find your help.
Get it? Got it? Good!
|
|
|
|
|
Do you really read and understand the question in the first post
So you really think that I didn't make severall search before to post ?
Do yo really think that you first answer gives some help and the right answer ?
Do you understand the meaning of my polite answer to your first post ?
You can get some satifaction to scold other and you are at the right place for that !
Get it? Got it? Thanks!
|
|
|
|
|
maybe
yes, at least not logical ones
yes
yes
yes
yes
|
|
|
|
|
|
Hi!
I've been trying to send Ctrl+s to notepad, but havent succesfully manage to do this. I've googled it, but havent found anyone who have sent a ctrl+letter command to a process.
Currently, the sending part of my code look like this:
IntPtr hWnd = FindWindow("Notepad", null);
IntPtr hWndChild = FindWindowEx(hWnd, IntPtr.Zero, "Edit", null);
int VK_CONTROL = (int)0x11;
uint wm_keydown = (uint)0x100;
uint wm_char = (uint)0x102;
uint wm_keyup = (uint)0x101;
PostMessage(hWndChild, wm_keydown, VK_CONTROL, 0);
PostMessage(hWndChild, wm_keydown, VkKeyScan('s'), 0);
PostMessage(hWndChild, wm_keyup, VkKeyScan('s'), 0);
PostMessage(hWndChild, wm_keyup, VK_CONTROL, 0);
I've also tried different values for the lParam parameter (taken from Spy++) and to use hWnd instead of hWndChild, but it does not work. Does anyone know any way to send Ctrl+s to notepad using PostMessage (or SendMessage)? I would really appreciate if anyone could post some sample code. Thank you!
|
|
|
|
|
Hi,
I'm not going to send you code; you should debug what you have yourself.
Did you manage to send regular text to Notepad at all?
if not, check values of hWnd, hWndChild, etc.
BTW: what is this VkKeyScan, if not your code, how to you reach it?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi ppl
Im again
In a data Entry software Most frequently usage is database Connection.
I have to insert data many tables in different forms. So I have to create diff connection for different table insert or update.
Like i have 3 forms. In 3 forms, I have to insert in 3 different table in a same database. So when I insert form1 in table1 then I have to create connection and close connection.
Again for form2 i have to do same jobs.
is there anyway to create one connection for all forms usage and close after manipulating, like "Visual Basic" ,module.
Or
any efficient way to do it?
or
Any Advice pls
Feel free to advice me
A lil detail of my problem:
i have to write all full conn every time.....
disgusting isnt it...like
//connection string
string connString = @"
server = HOME;
integrated security = true;
database = Monitoring
";
//query
string sql = string.Format(@"
SELECT Ins_ID, Ins_Nm
FROM Institution_Profile
WHERE Up_ID =
(SELECT Upazila_ID FROM Upazila
WHERE Upzila_NmB = '{0}')
", cmbUpazila.Text);
//create Connection
SqlConnection conn = new SqlConnection(connString);
try
{
//open Connection
conn.Open();
//create dataAdapter
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
//create dataSet
DataSet ds = new DataSet();
//fill dataset
da.Fill(ds, "Institution_Profile");
// get data table
DataTable dt = ds.Tables["Institution_Profile"];
foreach (DataRow row in dt.Rows)
{
cmbSchoolName.Items.Add(row["Ins_ID"].ToString() + " " + row["Ins_Nm"].ToString());
}
}
catch (Exception ex)
{
MessageBox.Show("Error:" + ex);
}
finally
{
conn.Close();
}
and again write the same code for another table insert or update...
------------
can i write once and use again n again
???
thanks
|
|
|
|
|
Nice answer today:
- create one session and use it for all your updates.
- use transations to ensure atomic units.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I forget to mention that im using for Windows application.
Does windows application support session?
Can you tell me a lil detail
Thanks
|
|
|
|
|
Can you tell me how to use google?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
im sorry but i didnt expect anything ques like that.
I understand what u mean...
Np thanks
Yes i can tell you...google it
|
|
|
|
|
It's bad practice to open a connection to the database and leave it sit idle. SQL Server connection licenses are quit expensive.
Normally, you'd get all of your data from the forms, open the connection, start a transaction, do all of your queries to update the database, commit the trasaction, and close the connection.
|
|
|
|