|
i suppose, that i need a system language for this purpose
|
|
|
|
|
Last time I did anything like this I had to create an NDIS driver and capture the traffic at the network card. This is not for the faint of heart and if you mess it up you are likely to pull down the entire operating system.
|
|
|
|
|
What about DLL injection?
|
|
|
|
|
Hi
I have used multithreading for udp client/server communication.When i run the server both the threads are executing at the same time.So i used a Thread.Sleep() after the 1st thread.So the 1st thread works properly.When it comes to the 2nd thread it gives"the existing connection was forcibly closed by the remote host".Can you please give me your suggestion
|
|
|
|
|
is it because thread 2 is being called from in thread 1? it would be better if you could post some example code
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Please give me your suggestion asap
public UdpServer()
{
try
{
startServer = new Thread(new ThreadStart(start_server));
startServer.Start();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Thread.Sleep(20000);
try
{
startServer2 = new Thread(new ThreadStart(start_server2));
startServer2.Start();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
} public static void start_server()
{
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 10001);
try
{
Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
newsock.Bind(ipep);
Console.WriteLine("Waiting for a client...");
while (true)
{
EndPoint tmpRemote = (EndPoint)ipep;
byte[] data = new byte[1024];
Console.WriteLine("hai");
int recv = newsock.ReceiveFrom(data, 0, data.Length, SocketFlags.None, ref tmpRemote);
Console.WriteLine("Message received from {0}:", tmpRemote.ToString());
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
data = new byte[1024];
string ss = "Welcome to the Server";
data = Encoding.ASCII.GetBytes(ss);
newsock.SendTo(data, 0, data.Length, SocketFlags.None, tmpRemote);
Console.WriteLine("\nSent Acknowledgement");
}
}
catch (SocketException e)
{
Console.WriteLine(e.Message);
}
}
public static void start_server2()
{
}
|
|
|
|
|
mrithula8 wrote: Please give me your suggestion asap
This is not the way people communicate here. No one gets paid to help anyone, they do it because they wish to.
जय हिंद
|
|
|
|
|
Sorry i didnt read the exception in your OP. That exception says that there is a problem with the host you are connected to. i.e. the server. This means the server is cancelling the connection for one reason or another, it could be your server is limiting connections to just one (your first thread) and thats why the second fails. I cant help much with this kind of thing, but you basically need to look at settings on your server somewhere.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hello,
I try for an exemple witch convert PDF file to text file, in : http://www.codeproject.com/KB/string/pdf2text.aspx[^]
<br />
using System;<br />
using System.IO;<br />
using org.pdfbox.pdmodel;<br />
using org.pdfbox.util;<br />
<br />
namespace Pdf2Text<br />
{<br />
class Program<br />
{<br />
[STAThread]<br />
static void Main(string[] args)<br />
{<br />
PDDocument doc = PDDocument.load(@"C:\Documents and Settings\abbd\Bureau\1.pdf");<br />
PDFTextStripper stripper = new PDFTextStripper();<br />
Console.Write(pdfStripper.getText(doc));<br />
<br />
}<br />
<br />
<br />
<br />
<br />
}<br />
}<br />
I have add : PDFBox-0.7.2.dll and IKVM.GNU.Classpath.dll
But i have this exception on line PDDocument doc = PDDocument.load(@"C:\Documents and Settings\abbd\Bureau\1.pdf"); :
An exception has been thrown by the type initializers for 'java.io.File'.
Help me please to resolve this problem, thank you verry mutch.
|
|
|
|
|
abbd wrote: Help me please to resolve this problem
No. Thank you verry mutch
|
|
|
|
|
I think your problem may be that you do not know that difference between C# and Java. more specifically on the level of how they are spelt differently.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi all,
I'm using the WebBrowser control. When I'd like to page down if I write something like;
webBrowser1.Document.Window.ScrollTo(0, y) ; // it is ok no problem
and also I can get easily ScrollBar lenght like;
scrolHeight= webBrowser.Document.Body.ScrollRectangle.Height // it is ok.
But I'm using the AxWebBrowser object which helps me much more than Default webBrowser control in C#.
So How can I do those.
Thanks.
|
|
|
|
|
Member 4651729 wrote: I'm using the WebBrowser control
Member 4651729 wrote: But I'm using the AxWebBrowser object
So which is it?
|
|
|
|
|
I'm sorry about that.
I'd like to learn how can I do these using AxWebBrower.
1-) webBrowser1.Document.Window.ScrollTo(0, y);
2-) scrolHeight= webBrowser.Document.Body.ScrollRectangle.Height;
Thanks.
|
|
|
|
|
Member 4651729 wrote: I'd like to learn how can I do these using AxWebBrower.
Well I can tell you the way I learned was to read the documentation[^]
|
|
|
|
|
how i can get system information like : computer name,processor and language in c#
|
|
|
|
|
Take a look at the System.Environment class
I are troll
|
|
|
|
|
I already look for this class, but it doesn't retreive processor details
and system model.
|
|
|
|
|
You're lucky, there's some articles on CP about just that[^] and more[^]
I are troll
|
|
|
|
|
Look into WMI for that and much more.
Computer name can simply be
System.Environment.MachineName;
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi all,
I am developing a Windows Service. This Service connects to a database and on every timer_tick retrieves new records from a database. The ID of the last record retrieved is being saved to the app.config file using the code below:
private void UpdateConfigFile(Int32 lastIndex)<br />
{<br />
Properties.Settings.Default.LastRecordId = lastIndex.ToString();<br />
Properties.Settings.Default.Save();<br />
}
The service works fine and on every timer_tick it picks up only the new records from the database, but if I open the <projectname>.exe.conifg OR <projectname>.vshost.exe.config the LastRecordId value is always 0. It seems like it is storing and reading the config file from memory or something.
Any help would be greatly appreciated
modified 1-Oct-21 21:01pm.
|
|
|
|
|
from memory the config file is a read only document for use in the program so no changes are stored to it. Plus if you change it outside the program while the program is running you need to restart the program for the new readings to take place.
You could save the value to another file that is pointed to by the config file.
|
|
|
|
|
So it makes more sense not to use the .config file in the first place for settings as these, and opt for a normal text file.
Correct?
modified 1-Oct-21 21:01pm.
|
|
|
|
|
No the config file is used for settings that apply to the application for ti's life time. Ie if you only want it to connect to a specific database or which error log source to write to.
For user settings it is not recommended I use it for some settings and point to other files from it.
google and you get some interesting results.
|
|
|
|
|
Ok thanks for the info. Will save the settings in a seperate text file then.
Cheers
modified 1-Oct-21 21:01pm.
|
|
|
|