|
Anonymous wrote:
Can you give few line example?
It would be better if you got a book on the subject. C# Network Programming by Richard Blum[^] is quite a good book on the subject. (Although all the examples in the book are in C# it is really the .NET Framework that is the important part. So everything mentioned will work for C#, VB.NET, Fujitsu COBOL.NET or whatever).
You will probably find that there is a better way from the book. You haven't really mentioned what you are trying to do, other than sending a file via TCP/IP (which is a bit vague and doesn't take into account things like people having firewalls that block your connection. You may decide a better way is using a web service - which would send the file via HTTP and therefor pass through a firewall)
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
|
You can send files to and from a share in your network if you only need to stay within an intranet. I've done this with system.IO.
Is this what you're refering to?
|
|
|
|
|
Hi To one and all
I am a web developer, now i have got an oppurtunity to grow in design part, but i have problem,
Since this is the first time i am working in design side , can anybody let me know the good approach, what is the best way to learn...
|
|
|
|
|
Hi,
I would like to know the Administrator Rights are there are not for the current user.
My application gives the computer name etc., when the user runs on his machine, at the same time I would like to know whether the user have Administrator rights or not.
Can any one help me.
Thanks,
Sreepathi
Sreepathi
|
|
|
|
|
<br />
using System.Security.Principal;<br />
using System.Threading;<br />
<br />
...<br />
...<br />
...<br />
<br />
WindowsPrincipal winId = (WindowsPrincipal)Thread.CurrentPrincipal;<br />
bool isAdmin = winId.IsInRole(WindowsBuiltInRole.Administrator);<br />
bool isPowerUser = winId.IsInRole(WindowsBuiltInRole.PowerUser);<br />
|
|
|
|
|
Hi Roman Rodov and all,
It doesn't work for me. Giving an error saying that the Specified cast is not valid.
Thanks,
Sreepathi.
Got it Thanks....
|
|
|
|
|
hi im despreately trying to find out how to send 'pulses' and 'waits' through the pocket pc (Ipaq 2210) infrared port. Im using C# and have researched all the technicalities of raw infrared but cannot figure out what kind of data to send.
I thought it was hexadecimal which represented the timings of the pulses and waits but these are in 2-byte forms and so eg 0015 0015 would have to be sent as 0x00 0x15 0x00 0x15 using WriteFile and this seems wrong.
Its a strange question but its urgent!
|
|
|
|
|
Hi,
I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question:
When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed.
Favourite quote:
In youth we learn, In age we understand.
|
|
|
|
|
the reason you need a reference to the server dll is so that .net can know the interface of your dll.
so you can basicly copy your server dll to a local folder and reference it from there.
there is no need to reference it at the server at all.
//Roger
|
|
|
|
|
Hi
I want to start working with Managed DirectX,
aftre I install the SDK I have Microsoft.DirectX....xml file and not DLLs
to references.
Am I nead to compile any project?
How I get the DLLs ?
Thanks
Koby
|
|
|
|
|
I have just started trying my hand at DirectX. Have you installed the SDK Update from...
http://www.microsoft.com/downloads/details.aspx?FamilyId=9216652F-51E0-402E-B7B5-FEB68D00F298&displaylang=en
|
|
|
|
|
Hi all,
I want to develop an arabic Windows CE based application and I need your help .
* I don't have a pocket pc device and I am developping using visual studio 2003 .Net and .net compact framework in my work and using its pocket pc emulator.
SO, My question is :
- How can I load and use an arabic font and make the emulator understanding its arabic characters ?
Please help me as quickly as possible ...
Thanks for your time ...
Alaa El-Din Moustafa
|
|
|
|
|
I'm trying to determine how I can identify the accounts used to start specific services (if other than the system account assigned by default). I cannot find any information on returning this information. I would assume the natural place would be the ServiceController class, but it does not appear to be there.
Anyone have any ideas? Thanks for the help!
|
|
|
|
|
All you need is a bit of WMI
<br />
...<br />
using System.Management;<br />
using System.Management.Instrumentation;<br />
...<br />
...<br />
public void GetAllStartupAccounts()<br />
{<br />
ManagementClass serviceClass = new ManagementClass("Win32_Service");<br />
ManagementObjectCollection services = serviceClass.GetInstances();<br />
foreach(ManagementObject service in services)<br />
{<br />
Console.WriteLine("{0} starts under account: {1}", service["DisplayName"], service["StartName"]);<br />
}<br />
<br />
}<br />
|
|
|
|
|
I have a few pages that have controls with postbacks. Each time a postback is performed, a "flash" is generated which is very distracting on the eyes. How would you recommend I correct this? I had thought of doing a page transition fade effect for the controls but I am unsure of how to do this or if this is the right way to correct the flash.
Any suggestions?
|
|
|
|
|
I'm building a server based around Asynchronous sockets. Clients connect and are asked to authenticate, messages are exchanged using XML. As soon as the client has been authenticated the socket is associated with an object representing the person.
The server is working fine except when clients disconnect. If the client disconnects without sending a message to the server (i.e. the connection just drops) then the Socket seems to be closed before some of the server's clean up code can be called -- an ObjectDisposedException is thrown. I need a reference to the Socket since the clean up uses various parts of the type to correctly clean up.
Is there any way to ensure that my clean up code is performed before the Socket is disposed? The Dispose method is intended to be used for releasing resources, which isn't strictly the case and it would also require the derived Socket type to essentially be aware of where it's being used.
All suggestions are very much appreciated,
Paul
--
Paul
"Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Download my PGP public key
|
|
|
|
|
How can I return the method that is called when an event is raised ?
System.Reflection.EventInfo.GetRaiseMethod does not work.
necati arslan
|
|
|
|
|
Are you looking for the method name? Or, a reference to the method?
Michael Flanakin
Web Log
|
|
|
|
|
I nead the method as System.Reflection.MethodInfo
necati arslan
|
|
|
|
|
Right off hand, I don't know. I would say that you can create a custom exception that passes the value, but I'm sure there's a better solution than that.
Michael Flanakin
Web Log
|
|
|
|
|
i have a asp.net c# project i connect to on a remote server from home. it opens fine but when i compile i get can't save to webserver .pdb(my local vs cache). first thing i do when project opened is sync all folders. any ideas.
ps only iexplore supports reg exp validator control, meaning that in netscape you must use the this.validate(), then this.isValid calls to make it work. I think this is a valid lawsuit for microshit.
|
|
|
|
|
Hi there,
On the login page of our .aspx intranet application, we use the system.directory namespace to query active directory using the username and password entered on the page. Something like the following.
oRoot = New DirectoryServices.DirectoryEntry("GC://dc=acme,dc=com, <username>,<password>)
oSearch = New DirectoryServices.DirectorySearcher
oSearch.SearchRoot = oRoot
oSearch.Filter = "(&(objectclass=user)(sAMaccountName=jbloggs))"
oResults = oSearch.FindAll()
We use GC:// instead of LDAP:// because we want to do a forest wide search as we have multiple domains. We have 3 Global catalogs within our network infrastructure. Most of the time this piece of code works find. But sometimes with no consistency, the application throws an error on the last line of the above code (oSearch.FindAll()). The error reported is 'The server is not operational'. Does anyone have any ideas, how does FindAll() work?
Thanks
Cammie
|
|
|
|
|
Greetings,
I am writing a program that installs an assembly into a remote machine GAC.
I am using the OpenRemoteBaseKey method to get the drive letter and path to where the .NET framework is installed. Now it works fine as an administrator going from one machine to another. But when I am a user it does not work. Okay I am fine with that.
How can set the security prinicple with this method to impersonate a adminstrator, whilst execute as a user?
I have the creditials that I need to pass in the process from an encrypted app settings file.
Thanks in Advance.
Cheers,
Campbell
|
|
|
|
|
You should really not be allowing applications to install anything in the GAC as a user level account. In fact you should not be allowing user level accounts to install applications at all
But if you must .....
To impersonate a user you need to use P/Invoke to call the LogonUser API from advapi32.dll to get a user token. Then you need to create a new WindowsImpersonationContext from this user token and call the Impersonate() method. After you've done the dirty work you should call Undo() to revert back to user level. And now an example: Windows Impersonation MSDN Example[^]
|
|
|
|