|
Thanks leppie,
My current issue is, I want to access a remote Web Services through https other than through http. In this case, I want to use server certificate, but not using the client certificate (one-directional authentication). And in my situation, simply accept all server certificate is fine, and I just need the traffic encryption feature of https.
But I can not find such samples both in my books and in the internet. So I come here for help. Do you have any documents or samples to make a reference?
regards,
George
|
|
|
|
|
Hi,
I am developing forums website...here I need to do code for rating an article in C#.anybody know plz reply me..
thanks
Raaj
|
|
|
|
|
It depends on the design of your overall system. There is no universal way to "rate an article" in C#.
I would imagine that you have some sort of data store that contains the article. You can have some sort of association with metadata which stored things like article ratings.
|
|
|
|
|
Yes there is...
Go to a book store, buy a book of C#. And please start reading it.
|
|
|
|
|
oh....good answere.thanks..If u dont know means,dont reply ok........
Raaj
|
|
|
|
|
Hi guys! Does anyone out there know how to help me about this issue? I want to have a button at my app where the user can check for a newer version. I already uploaded the app on a server, and in the publish properties everything is setup for checking for newer version, but how should I code a button for checking for updates? Thanks
|
|
|
|
|
Something like this should work:
...
ApplicationDeployment ad;
UpdateCheckInfo info;
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
{
ad = ApplicationDeployment.CurrentDeployment;
info = ad.CheckForDetailedUpdate();
if (!info.UpdateAvailable)
{
MessageBox.Show("No Update Available", "Update Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
bool doUpdate = true;
if (info.IsUpdateRequired)
MessageBox.Show("There is a required update available. Downloading now","Software Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
else
if (MessageBox.Show("A new Softwrae Update is Available. Download now?", "Software Updates", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
doUpdate = false;
if (doUpdate)
{
ad.Update();
MessageBox.Show("The Updates have been downloaded. Restaring application", "Upgrade Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Restart();
}
}
...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi all,
I would like to know whether the following would be wise or not:
Seeing that 'System.Threading.Thread.Suspend()' is obsolete, I want to create two threads and declare an enumeration to store some thread states (not referring to ThreadState). I.E:
public struct THREAD_STATUS
{
public int threadWorking;
public int threadSleeping;
}
When the one thread wants to do some processing, it first check the state of the other thread before proceeding. Should the state be in threadSleeping state the one thread puts the other one in a Suspend state and can continue processing, thus the following can be prevented:
A thread may be performing a system-wide-synchronized operation like locking a range of bytes in a file, writing to those bytes, unlocking those bytes, then closing the file. A thread is suspended before the unlock, that range of bytes will remain locked for an indeterminate amount of time until the thread is resumed or the process terminates
Will this be a good approach?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: I want to create two threads and declare an enumeration to store some thread states (not referring to ThreadState). I.E:
why retype something thats already been written for you?
|
|
|
|
|
Well thank you for pointing that out. Now to get back to my question; is it a good approach?
Many thanks again...
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
You could also try using the Monitor class (really nifty).
eg.
<br />
ArrayList TempAl = new ArrayList();<br />
<br />
Monitor.Enter(TempAl);<br />
TmpAL.Add("test text");<br />
Monitor.Exit(TempAL);
Althought if you were using an array list, its better to load the values into a temporary array (or array list), then process it, then re-enter the Monitor at a later stage, and append the changes (depending on how much processing you had to do).
|
|
|
|
|
Hi,
Programm3r wrote: I want to create two threads and declare an enumeration to store some thread states (not referring to ThreadState). I.E:
No this is not a good approach, as it is not promoting code reuse.
Programm3r wrote: When the one thread wants to do some processing, it first check the state of the other thread before proceeding. Should the state be in threadSleeping state the one thread puts the other one in a Suspend state and can continue processing, thus the following can be prevented:
A thread may be performing a system-wide-synchronized operation like locking a range of bytes in a file, writing to those bytes, unlocking those bytes, then closing the file. A thread is suspended before the unlock, that range of bytes will remain locked for an indeterminate amount of time until the thread is resumed or the process terminates
If I've read correctly your process is fine. The usual approach when dealing with two threads that are sharing one resource is to use a mutex semaphore to block one thread while the other is doing some work.
I believe that .NET has classes (Mutex, Semaphore) in System.Threading that support this.
I hope this helps,
Cheers,
|
|
|
|
|
I Wount To Serialise All Controls In Windows Application
I Put This Code To Serialise the Button
/**************************************************/
/**************************************************/
private void serialize( )
{
Stream stream = File.Open("Thaer.xml",FileMode.Create);
SoapFormatter formatter = new SoapFormatter();
object obj = this.button1;
formatter.AssemblyFormat=System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Full;
try
{
formatter.Serialize(stream, obj);
}
catch { }
}
/*****************************************************/
/*****************************************************/
But This Code In .Net Give Me This Exeption :-
Type 'System.Windows.Forms.Button' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
I Wount To Serialise The Button As Object And The TextBox
The Serialisation of it Must Have The Status Of It As Visible Or Hiden And The Size And Colore And and so on But Without Declare The Variable For It ,I wount to Serialise the Button With His Proper........
Who I Can Do It ?
Thaer
|
|
|
|
|
If you want to serialize a class, you must set put an attribute, for example:
[Serializable]
public class MyClass
{
}
I think you cannot serialize a button.
|
|
|
|
|
thanks Mr stancrm .
But Are You Sure I Can't Serialise the Controle .
My Manager is pressing To Serialise the control in Windows Application Or Web Application , From Last Day I Research on the EnterNet To Serialisation The Controls in Form by Using the C#.Net , I Don't Know What I Can Do .
Thaer
|
|
|
|
|
thanks Mr stancrm .
But Are You Sure I Can't Serialise the Controles .
My Manager is pressing To Serialise the control in Windows Application Or Web Application , From Last Day I Research on the EnterNet To Serialisation The Controls in Form by Using the C#.Net , I Don't Know What I Can Do .
Thaer
|
|
|
|
|
You cant serialize controls and many other classes. You need to find specific data you want to save/restore, and serialize that.
|
|
|
|
|
Hi,
kindly help me that, how to read null values from datagridview?
Thanks in advance
(Riaz)
|
|
|
|
|
You read it like any other value. E.g.
object cellValue = dataGridView.Rows[0].Cells[0];
Doesn't matter whether it's null or not. Does this answer your question?
|
|
|
|
|
i am facing an error "NullReferenceExeption was unhandled" using following codes.
object oValueChecker = Convert.IsDBNull(dataGridView1[5, e.RowIndex].Value)? "0" :
dataGridView1[5, e.RowIndex].Value.ToString().Trim();
if (oValueChecker == "0")
{
dataGridView1[5, e.RowIndex].Value = "0";
}
|
|
|
|
|
Hi.
Have you tried
if (string.IsNullOrEmpty(dataGridView1[5, e.RowIndex].Value.ToString()))
{
dataGridView1[5, e.RowIndex].Value = "0";
} I think it should work.
Kjetil
|
|
|
|
|
Kjetil Svendsen wrote: string.IsNullOrEmpty(dataGridView1[5, e.RowIndex].Value.ToString())
IF the Value property is null, you will still get a NullReferenceException .
|
|
|
|
|
M Riaz Bashir wrote: Value.ToString()
If Value is null , ToString() will FAIL!
|
|
|
|
|
How to get default printer name while calling the windows service using c#?
vinu
|
|
|
|
|