|
|
I need a sample online quiz application
|
|
|
|
|
Well try google then. Nobody is going to do your homework for you. You have been given a straight forward explanation, so try coding it.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hi.....
i am doing my final year project in C# integrated with grid.
i have a problem here which is...
i want to connect all computers in my lan network using ip address and need to access the file contents present in them....
i have connected the computers using this coding,
Console.Write("Enter the IPAddress of the file:");
string ipadd = Console.ReadLine();
IPAddress[] ips = Dns.GetHostAddresses(ipadd);
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Console.WriteLine("Establishing Connection to{0}", ipadd);
s.Connect(ips[0], 9001);
Console.WriteLine("Connection Established");
now i want to access the file contents present in that system.is it possible and i would do it through the use of streamreader class........
the important thing is it is not a client-server coding....
it is a single application coding that needs to access another system's file contents...
thanx in advance.
|
|
|
|
|
thivya n wrote: the important thing is it is not a client-server coding
It is by its very nature client/server as you cannot do this without having a listener (aka server) socket on the destination computer.
MVP 2010 - are they mad?
|
|
|
|
|
is it not possible to connect a socket(connected to other system) to a streamreader to access a file contents...
|
|
|
|
|
I think so, take a look at this article[^] here on CodeProject.
MVP 2010 - are they mad?
|
|
|
|
|
the article u mentioned is based on a server and a client.
but the one i require is for a single-ended application......
connection between a socket and a stream......
could u help me with that.....
|
|
|
|
|
I guess in theory, though that is not the problem.
As has been said, creating a socket from machine A to machine B is no good to you if nothing is on the other end of the socket. All sockets require an endpoint for communication, in this case a service on the remote machine that sends you the file content.
If, as it seems, you are writing a single ended application you just need to create a stream reader on the remote file using the UNC path. This of course assumes the network security setup is such that you have access to the file on the remote computer.
|
|
|
|
|
could u help me ur idea explained with an example! please...
also the project i am doing is an integration of grid computing and C# console application, so it is a single-ended application...
the main idea i want to implement is...
1.connect to a remote computer using its ip address from my computer in LAN.
2.specify the path of the file in the remote computer from my computer.
3.read its contents through a stream reader.
4.access its contents using stream writer.
thanks in advance.
|
|
|
|
|
I think there are two possibilities you can try:
1. Create a client server setup where the server connects to the cient, and a reader on the client feeds the file data back to the server.
2. Create a reader on the server that accesses the client's filesystem directly, via network shares.
I do not know of any way, and I think it would be very dangerous, that a server could access a client's filesystem without the client's permission and active assistance.
MVP 2010 - are they mad?
|
|
|
|
|
Hi there,
Screencaptureing seems to not let go of me. Right now I'm using the Method Graphics.CopyFromScreen to capture screen images (whole desktop and parts of it) and I think, that using this method is quite costly regarding CPU and memory consumption.
So I'm wondering how other projects deal with this task... I don't want to reinvent VNC or something. The goal here is to grab a movie-like thing from the desktop with minimum CPU/memory consumption.
Is there a best practices guide or something floating around? I need everything from algorithms to actual source code...
Thank you very, very much in advance!
Best regards,
Stevie
Greetings,
Stephan Eberle
hawke@deltacity.org
|
|
|
|
|
If you decompile Graphics.CopyScreen with Reflector you can see it's quite simple
DeviceContext context = DeviceContext.FromHwnd(IntPtr.Zero))
SafeNativeMethods.BitBlt(...)
I don't see how you can improve on that...
And I believe VNC does that the 1st time then plug a Window Hook on the WM_PAINT event to repaint just what's needed... (through GDI, miss the DirectX stuff)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi,
hooking WM_PAINT sounds like a good way, but how is it done? Is every application hooked or is there some über-hook to catch all redraws appearing?
Thank you,
Stevie
Greetings,
Stephan Eberle
hawke@deltacity.org
|
|
|
|
|
problem is.. you can't do WM_PAIN hook in C# (in fact I'm not sure you can hook WM_PAINT) but anyway, here are some links:
Global Windows Hooks[^]
http://msdn.microsoft.com/en-us/library/ms997537.aspx[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Thank you,
this looks like fun, ... not...
I'll try to implement GetMessage-hooking. Seems that's the best approach (to me)...
Thank you for your help!
Best regards,
Stevie
Greetings,
Stephan Eberle
hawke@deltacity.org
|
|
|
|
|
hello,
I would like to ask where does I still get this run time error
"Syntax error in INSERT INTO statement."
I get the error from this line of my code
da.Update(ds, "employeeTable")
for mode details below here is my code:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim cb As New OleDb.OleDbCommandBuilder
Dim dsNewRow As DataRow
'con.Open()
cb = New OleDbCommandBuilder(da)
dsNewRow = ds.Tables("employeeTable").NewRow
ds.Tables("employeeTable").Rows.Add(dsNewRow)
txtEmployeeID.Text = "5678"
dsNewRow.Item("employeeID") = txtEmployeeID.Text
da.Update(ds, "employeeTable")
con.Close()
End Sub
Thanks,
dfan23
|
|
|
|
|
how many times are u gonna ask this question buddy? Did you read the link i sent you?
|
|
|
|
|
Hello,
sorry if I ask again but I have read it and you have tell me that command builder is not
working if no primary key. I also tried others code but still this error keep still.
Sorry if this is not a good question.
Thanks,
dfan23
|
|
|
|
|
ok. I understand that sometimes it becomes frustrating when you don't get a job done. But please maintain a single thread of question. Posting the same question many times is not gonna solve it. Someone who has already responded you will be in a better position to help you out.
In any case, what we are gonna do is to create a table and get it done.
create a new table in your access database and name it: "MyTable".
Create three columns:
1. ID = AutoNumber =>Set it as key (You need to right click on the column and select primary key)
2. FirstName = Text
3. LastName = Text
Now, write this code in your program:
Dim con As New OleDb.OleDbConnection
Dim inc As Integer
Dim MaxRows As Integer
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim dt As DataTable
Private Sub Sampler_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ds = New DataSet("dataSet")
dt = New DataTable()
ds.Tables.Add(dt)
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + _
"Data Source = c:\Sadsign.mdb"
'This is where we load the table
con.Open()
sql = "SELECT * FROM MyTable"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(dt)
con.Close()
'This is where we add a new row in the table
Dim row As DataRow = dt.NewRow()
row.Item("FirstName") = "MyFirstName"
row.Item("LastName") = "MyLastName"
dt.Rows.Add(row)
'This is where we update the table in database.
con.Open()
sql = "SELECT * FROM MyTable"
da = New OleDb.OleDbDataAdapter(sql, con)
Dim cb As New OleDb.OleDbCommandBuilder(da)
da.Update(dt)
con.Close()
'We Are Done
End Sub
Now, this code is working on my computer so, it should work on yours too provided you did exactly as i said.
|
|
|
|
|
Hello,
I would like to thanks you Mr. Som Shekhar, sir
thanks for the patient for helping me and I'm sorry for being so frustrated
I have coding this and reading alot for almost a week but still
I got the same error. Thanks and best regards for helping others like me.
Thanks,
dfan23
|
|
|
|
|
So, is it sorted now?
if yes, then rate the answer and mark it as solution to your problem.
|
|
|
|
|
hello,
A big 5 is really nice for you sir.
Thanks,
dfan23
|
|
|
|
|
u r welcome. and please stop calling me sir. we all have gone through this phase and i am just returning the favor of someone else who helped me in the past.
cheers!!
|
|
|
|
|
Hello,
now I can move on the next part of coding
for the system I'm planning to create.If ever I cant figured out again
my problem going to post it again here.
Thanks again for the help.
Thanks,
dfan23
|
|
|
|