|
Open up your Visual Studio and try something. If you get stuck up somewhere, then come back and ask for help. We would be happy to help you then
|
|
|
|
|
|
Hi everyone, I have a problem. Some of my code only works when debugging with breakpoint on it. Anyone knows the reason?
By the way I'm newbie in this area so maybe I made stupid little error.
private void timer1_Tick(object sender, EventArgs e)
{
if (tcpListener.Pending() == true)
{
hostSocket = tcpListener.AcceptSocket();
if(hostSocket.Poll(1, SelectMode.SelectRead))
{
int numBytes = hostSocket.Available;
Byte[] data = new Byte[numBytes];
hostSocket.Receive(data);
timer1.Stop();
string msg = System.Text.ASCIIEncoding.ASCII.GetString(data);
string[] co = msg.Split(' ');
Console.WriteLine(msg);
}
}
}
modified on Monday, November 9, 2009 5:53 AM
|
|
|
|
|
Hi,because you've put the data receiving code in the 'if(tcpListener.Pending()){} statement this only works when you put a breakpoint on it. That is because only then the client has the time to send data before the next time the timer fires an event and the tcpListener.Pending() returns false.
This should solve it:
if (tcpListener.Pending() == true)
{
hostSocket = tcpListener.AcceptSocket();
}
else if (hostSocket != null)
{
if (hostSocket.Available != 0)
{
int numBytes = hostSocket.Available;
Byte[] data = new Byte[numBytes];
hostSocket.Receive(data);
string msg = System.Text.ASCIIEncoding.ASCII.GetString(data);
string[] co = msg.Split(' '); Console.WriteLine(msg);
timer1.Stop();
}
}
Regards
|
|
|
|
|
Thanks, Jorgdedecker.
It works like a charm
|
|
|
|
|
When I double click an *.xsd file in Visual Studio 2008 I only got the markup code. When I rightclick and choose “View Designer” I only got a blank page. I’ve tried to repair the installation and installed SP1. Any tip what can be done?
_____________________________
...and justice for all
|
|
|
|
|
Hi Team,
I have a functional requirement in C#.net to develope a plug-ins and implement in outlook.
Could any body help me out from this scenario from high level or code level context.
Thanks in Advance.
Regards
Tarun Singh
Sr. Software Engineer.
mailto:tksingh@zenta.com
|
|
|
|
|
codeproject_Tarun wrote: I have a functional requirement in C#.net to develope a plug-ins and implement in outlook.
This[^] was not too difficult.
|
|
|
|
|
could you provide the way of technical approach toward achieve this.
Regards
Tarun Singh
Sr. Software Engineer.
mailto:tksingh@zenta.com
|
|
|
|
|
codeproject_Tarun wrote: could you provide the way of technical approach toward achieve this.
Well I gave you a link to a number of examples showing what you asked for, so I don't know what more you expect.
|
|
|
|
|
Hi.
I have 2 applications:
One is simple windows application and the other is web service.
They are both on the same machine, windows server 2003 - SP2.
exactly the same code in both:
X509Certificate Cert = X509Certificate.CreateFromCertFile("...some path\\export.cer");
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://...some URL...");
Request.ClientCertificates.Add(Cert);
Request.UserAgent = "Client Cert Sample";
Request.ProtocolVersion = HttpVersion.Version11;
Request.KeepAlive = true;
Request.Method = WebRequestMethods.Http.Post;
..
byte[] postBytes = Encoding.ASCII.GetBytes(strRequest);
System.IO.Stream requestStream = Request.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
..
HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();
In the windows application (running under logged in user) - I get response and all OK
In the web service (running under NETWORK SERVICE) - I get errors:
{"The underlying connection was closed: An unexpected error occurred on a send."}
{"Authentication failed because the remote party has closed the transport stream."}
Checking with the other side (who gets my requests) it seems like when I'm sending from the windows application they get the request with the certificate and in the case of web service they get the request without the certificate.
In the machine that sends the both requests, in the certificate store, the certificates are stored in: "Certificates (Local Computer) --> Personal --> Certificates".
Any ideas why is one sending the certificate and the other doesn't?
|
|
|
|
|
It depends on what account your web service is configured to run. Since you have stored your certificates in the personal store (which I believe is unique for each account), the account under which your web service runs does not find the certificate or does not have the appropriate access permissions to read it.
|
|
|
|
|
from emptbl: only name is vimla and his mobile number
|
|
|
|
|
What does this mean ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
SELECT name, mobile FROM emptbl WHERE (name = 'Vimla')
|
|
|
|
|
How on earth did you manage to interpret that?
|
|
|
|
|
it happens
|
|
|
|
|
|
On one machine [A] in local network there is SQL server 2005 express installed.
The connection string is:
"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\dbs\database.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
I need to connect to that db from another machine [B] on the local network.
I changed . to SQL server machine IP. But got Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error
I also tried to add
User Id=myUserName;Password=myPassword but have the same error with user name and password of the user on machine [A]
How to provide access from machine [B] to the SQL server on machine [A]
I'm coding C# service application, not ASP.NET site
Чесноков
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:19am.
|
|
|
|
|
Thank you for the link, I knew it and used that samples but without success.
Have you tried that connection between servers yourself?
Чесноков
|
|
|
|
|
Try This:
"Data Source=.\SQLEXPRESS;AttachDbFilename=\\[A]IP\[C]SharingLabel\dbs\database.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
EX:
"Data Source=.\SQLEXPRESS;AttachDbFilename=\\192.168.0.1\sanforjackass(C)\dbs\database.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
|
|
|
|
|
That is a nice trick to try, but it should work with user\pass items in any case
Чесноков
|
|
|
|
|
In order to use the Username and Password options in the connection string, you have to remove the "Integrated Security" option.
|
|
|
|
|
Dear Friends,
I have installed my application with .NET 2003 and crystal report 10 but still I am not able to display the out put on crystal report. When I debug it gives no error when it tries to create object of crystal report
rptAssetCondition rpt=new rptAssetCondition
Windows gives me error message IIS worker process stopped working.
I am really very upset with Windows 2008 server even I have installed everything as my development environment still I am not able to trace the error .
Your quick help will be highly appreciated.
Thansk and best regards
Murtuza Patel
|
|
|
|