|
size changed;
and test whether form.WindowState is minimized.
|
|
|
|
|
Ah ok, thanks. That worked. Now we're at it, would anyone happen to know how to make my mdi client window dock to its parent?
Thanks again, cheers.
|
|
|
|
|
I'm not entirely sure what you're asking. Do you mean maximizing it?
|
|
|
|
|
I mean having it stick to a specific side of its parent, just like controls can. Actually, this is easier than I though. Just set an mdi parent and set the dock property for you form to try it out.
|
|
|
|
|
Hello i want to create an answering machine that automatically picks up and responds to calls recieved through the vonage VOIP service. I can't seam to find any documentation on the internet relating to this. I would greatly appreciate it if someone could point me in the right direction.
Thanks,
Steve
|
|
|
|
|
It's highly ulikely that you can do this. Vonage is tied to your adapter's MAC address. The way it works is that when you power up your Vonage adapter, it connects to the Vonage service, and this service knows your device strictly by it's MAC address. This allows it to bypass firewall restrictions, because it calls in to Vonage and keeps a constant connection rather than Vonage trying to connect to you.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
Thanks for the info. I am now looking into SIP based VOIP services. My idea is to login to the VOIP service and forward the packets sent from a remote phone through my computer to my SIP phone at another location. This will enable me to examine the SIP messages as they pass backwards and forwards to my phone, and log the call.
P.S There dosen't seam to be any API's for using SIP on .NET or on Windows, i don't know Java so one in C# or C++ would be ideal.
Thanks in advance,
Steve
|
|
|
|
|
Hi
Guys , how can i make client server in C# can any one provide me the code for example, thankx in advnace
|
|
|
|
|
There is more than one way to make client server applications in C#,
u can go for .net remoting technology. u can easily find helping material on net.
this article will help u
www.c-sharpcorner.com/Network/RemotingInNETM.asp
|
|
|
|
|
Hi,
Indeed there are several ways to create an client - server architecture in c#. It only depends on the type of data you want to transmit. If you want data over the Network then you should try using Socket (System.Net.Socket). If you need an example let me know.
Do your best to be the best
|
|
|
|
|
OK
Man provide me the example so i can work it out , thankx in advance
|
|
|
|
|
Well,
It is very important to understand that sockets exchange only byte arrays between them, regardless of what the byte arrays contain (file, string message etc.). So it is very important that when you receive something to know what you receive. At first you should try to create your own communication protocol.
In my example the client send a string message and the server receives it
For the server:
<br />
Socket server = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);<br />
m_tcpListener.Bind(new IPEndPoint(IPAddress.Any,10000>));
Socket client = server.Accept();
byte []buffer = new byte[1024];<br />
int read = 0;<br />
string receivedMessage = "";<br />
while ( (read = client.Receive(buffer)) != 0 )<br />
{<br />
receivedMessage = String.Concat(Encoding.ASCII.GetString(buffer),receivedMessage);<br />
if (read < buffer.Length)<br />
break;<br />
}<br />
client.Shutdown(SocketShutdown.Both);<br />
For the client:
<br />
Socket client = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);<br />
client.Connect(new IPEndPoint(Dns.Resolve("127.0.0.1").AddressList[0],10000));<br />
string message = "This is a test";<br />
client.Send(Encoding.ASCII.GetBytes(message));<br />
client.Shutdown(SocketShutdown.Both);<br />
Hope it helps
Do your best to be the best
|
|
|
|
|
Thankx man for ur example when i am using this code snippet of the server it is giving the error on this
m_tcpListener.Bind(new IPEndPoint(IPAddress.Any,10000))
and shows no method of the tcp listener with the name of bind thers is the Server property of TCP Listener which have the method Bind , but its not workin plzzzzzzz, Reply me ASAP,thankx for ur reply.
|
|
|
|
|
Hi,
I must appologise. Please in the server code replace TCPListener with Socket. I confused the server declaration
Do your best to be the best
|
|
|
|
|
...or the easist way if it's sufficient for your purposes is ASP.NET webservices.
Regards,
Rob Philpott.
|
|
|
|
|
Well i don't want to use web services , iknow abt the web services , but i wanna make client Server with out web services, thanks in advance
|
|
|
|
|
hi folks,
i know how to use crystal reports in asp.net with c#. but it connected with only one table at a time but i need to connect different table with single rpt file ,if any one knows about this plz share with me
regards,
ranandbe
|
|
|
|
|
you should create view in database for connect many table a time
|
|
|
|
|
thanx for reply,
plz give me sample code
regards
ranandbe
|
|
|
|
|
Hi,
I am using the following code to encrypt/decrypt a connection string in my app.config file:
private void ProtectConfiguration()<br />
{<br />
<br />
config = ConfigurationManager.OpenExeConfiguration(myGlobalFilePath);<br />
<br />
string provider =<br />
"DataProtectionConfigurationProvider";<br />
<br />
<br />
ConfigurationSection connStrings =<br />
config.ConnectionStrings;<br />
<br />
if (connStrings != null)<br />
{<br />
if (!connStrings.SectionInformation.IsProtected)<br />
{<br />
if (!connStrings.ElementInformation.IsLocked)<br />
{<br />
connStrings.SectionInformation.ProtectSection(provider);<br />
<br />
connStrings.SectionInformation.ForceSave = true;<br />
config.Save(ConfigurationSaveMode.Full);<br />
<br />
Console.WriteLine("Section {0} is now protected by {1}",<br />
connStrings.SectionInformation.Name,<br />
connStrings.SectionInformation.ProtectionProvider.Name);<br />
<br />
}<br />
else<br />
Console.WriteLine(<br />
"Can't protect, section {0} is locked",<br />
connStrings.SectionInformation.Name);<br />
}<br />
else<br />
Console.WriteLine(<br />
"Section {0} is already protected by {1}",<br />
connStrings.SectionInformation.Name,<br />
connStrings.SectionInformation.ProtectionProvider.Name);<br />
<br />
}<br />
else<br />
Console.WriteLine("Can't get the section {0}",<br />
connStrings.SectionInformation.Name);<br />
<br />
}<br />
<br />
<br />
private void UnProtectConfiguration()<br />
{<br />
<br />
config = ConfigurationManager.OpenExeConfiguration(myGlobalFilePath);<br />
<br />
ConfigurationSection connStrings =<br />
config.ConnectionStrings;<br />
<br />
if (connStrings != null)<br />
{<br />
if (connStrings.SectionInformation.IsProtected)<br />
{<br />
if (!connStrings.ElementInformation.IsLocked)<br />
{<br />
connStrings.SectionInformation.UnprotectSection();<br />
<br />
connStrings.SectionInformation.ForceSave = true;<br />
config.Save(ConfigurationSaveMode.Full);<br />
<br />
Console.WriteLine("Section {0} is now unprotected.",<br />
connStrings.SectionInformation.Name);<br />
<br />
}<br />
else<br />
Console.WriteLine(<br />
"Can't unprotect, section {0} is locked",<br />
connStrings.SectionInformation.Name);<br />
}<br />
else<br />
Console.WriteLine(<br />
"Section {0} is already unprotected.",<br />
connStrings.SectionInformation.Name);<br />
<br />
}<br />
else<br />
Console.WriteLine("Can't get the section {0}",<br />
connStrings.SectionInformation.Name);<br />
<br />
}
However whenever I encrypt and decrypt the connectionStrings section of the app.config file, the connection string is not what I entered, it comes out as:
<connectionStrings><br />
<clear /><br />
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"<br />
providerName="System.Data.SqlClient" /><br />
</connectionStrings>
I am trying to encrypt the following connection string:
<connectionStrings><br />
<add name="MyDbName" connectionString="Data Source=MYDBSERVER;Initial Catalog=MYDBNAME;Integrated Security=False;User ID=MYID ; Password=MYPASSWORD" providerName="System.Data.SqlClient"/><br />
</connectionStrings>
Any ideas what I could be doing wrong?
Thank you in advance.
|
|
|
|
|
solved it. was trying to open config file instead of:-> exe
|
|
|
|
|
can anyone tell me, how can i return values from threads in C#?
Reply will be appreciated
Thanx in advance
|
|
|
|
|
You will have to drop the return value in a place that is accessable by another thread. You will have to protect the storage with a mutex, also add a condition to signal the other thread that processing is done. This is needed because processes can't return things to eachother, instead they storage data that has to be exchanged in a central place that is accessable by others.
These two steps start the threads and let the first thread wait for a signal of the other thread.
Thread 1 -> Thread2.Start();
Thread 1 -> Condition.Wait();
These steps are performed by the second thread in such a way that the storage can only be accessed by one party at a time. After the second thread is done, it will signal the first thread that it's done.
Thread 2 -> Mutex.Lock();
Thread 2 -> Set some value
Thread 2 -> Mutex.Unlock();
Thread 2 -> Condition.Signal();
These last steps are performed after the first thread gets a signal that the second thread is done.
Thread 1 -> Mutex.Lock();
Thread 1 -> Get value
Thread 1 -> Mutex.Unlock();
I'm not sure to what extend Microsoft implemented threading and concurrency tools, but if you don't have the Mutex or the Condition, you can do it with a Semaphore. The same trick, except for these changes:
Thread 1 -> Semaphore.P();
Thread 2 -> Set value in storage
Thread 2 -> Semaphore.V();
Thread 1 -> Get value from storage
This classic is also called the producer/consumer scenario.
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi ,
I'm Working on dataGridView i want the datagridview to scroll to specified row
like if the row # 10 is selected i want to jump to other row like row # 1010
this easy by using dataGridView1.Rows[1010].Selected = true;
but how can i make the dataGridView to scroll to that row
Thx for ur help
Regards,
Charbel
|
|
|
|
|
Hello
MyDataGridView.FirstDisplayedCell = MyDataGridView.Rows[MyIndex].Cells[0];
Sorry! Requires .Net 2.0
Regards
|
|
|
|