|
Hi ,
Shy Thanx for your reply.
Actually I dont want to get just the Devices name , but the actual device when u share your CD rom drive on netwrok , any one on netwrok can use ur drive and access th CD data in that CD rom drive.
So I want something like that .
Any sugestions ?
Thanks
ZINK
|
|
|
|
|
AFAIK, sharing devices over the internet is impossible. Sharing them accross network computers IS.
However, I don't know how to make a device shared using code...
You would probably need to find the API function appropriate for the job.
Search CodeProject for articles, or google it...
Good luck,
Shy.
Added:
If, however, you want to enable browsing and controling of hardware devices over the internet, you would have to write a client-server application, in which the server sends information to the client regarding the devices, the client sends requests for information, and requests for execution of stuff (creating directories, deleting files, etc.), and so on...
You would have to design you're own protocol I guess.
|
|
|
|
|
HI Shy ,
Thanks for your reply.
Yeh I have socket application runing on client and server. And I want that when client want to access data on cd on Server's CD Drive , server reads that data and send to client .
But not sure how to do this ???
Regards,
ZINK
|
|
|
|
|
Well... That's a much bigger issue... These are stuff you need to figure out on your own.
Search for articles and code exemples to get the idea...
Here are a few ideas and guidelines:
- You can use .NET Remoting to use objects from the server on you client.
This will release you from the need of designing an entire protocol.
You would simply instantiate an object and use it as if it was an object instantiated on the client's side.
So find material on .NET Remoting!
- If you intend to use serialization, here are a few ideas:
Lets say the client wants to receive a list of the directories in drive c:.
You can create a class which will hold the requested path, like so:
[Serializable]
class DirectoryListRequest
{
private string pathToExplore;
...
} Then you instantiate an object of type DirectoryListRequest and serialize it to your NetworkStream .
The server then deserializes it, reads the pathToExplore field and instantiates its own object of type DirectoryListReply .
Then the server serializes the DirectoryListReply object to the NetworkStream , and the client deserializes it, and so on...
Good luck,
Shy.
|
|
|
|
|
|
matjame wrote: I want to knw if its possible to call a .css file on c#
No. CSS contains no functionaltiy for C# to call
matjame wrote: All I need is its layout to appear on my c# webpage.
Web pages are written in HTML, not C#. You can get aspx pages which are converted to HTML by the server, but CSS is not applied to the codebehind, it is applied to the HTML.
matjame wrote: Step by step on how to do this would be nice thank you very much
If you "View Source" on this web page you'll see how it is done.
<link rel="stylesheet" type="text/css" href="/styles/global.css" />
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
I tried it but its givin me errors.
I will see if I cant fix it but Im battling.
And wer do I put it.
kagiso
|
|
|
|
|
matjame wrote: And wer do I put it.
It goes near the top of the HTML or ASPX file. As I mentioned before: View the source of this page for an example.
Maybe it would be best if you bought a book on ASP.NET and learn the foundations of how it all works and hangs together.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Hello everyone,
Well I’m working in a C#2.0 desktop application and I’m using numericupDown Objects to take numeric input. The only problem I’m having is that it can take more than one decimal points and I want to some how stop that thing from happening, like the control should not accept a decimal point when it already has one. So can u plz help me in this?
Thanks in advance,
Rocky
|
|
|
|
|
You can try the following:
- Create a new component, which inherits System.Windows.Forms.NumericUpDown .
- In your new component override the OnTextBoxKeyDown() method, and inside it put code like this:
protected override void OnTextBoxKeyDown(object source, KeyEventArgs e)
{
if (e.KeyCode != Key.Decimal || !Text.Contains("."))
base.OnTextBoxKeyDown(sender, e);
} This should disable calls to base.OnTextBoxKeyDown() when the user presses the decimal key, and a decimal point is already present.
Regards,
Shy.
|
|
|
|
|
hi,
the code provided by Shy will prevent the user from entering more than one decimal if and only if the user uses the key board to enter the data. what if one chooses to copy paste the data??
to handle this you need to override the event handler for ValueChanged and check for the decimal character.
regards
|
|
|
|
|
thats a very good point u know... thanks
|
|
|
|
|
1119 wrote: the code provided by Shy will prevent the user from entering more than one decimal if and only if the user uses the key board to enter the data. what if one chooses to copy paste the data??
You're right... I didn't think about it...
1119 wrote: to handle this you need to override the event handler for ValueChanged and check for the decimal character.
Wouldn't that cause flickering text?
That is, If a second decimal point is now present, and through ValueChanged you set the Text property to remove it.
The text would be drawn once before your code executes, and once after.
|
|
|
|
|
shyagam wrote: Wouldn't that cause flickering text?
no, i don't think so. it will be fired only after the value is changed, just like the keypress event handler is fired for every key pressed. and if keypress event handler doesn't cause flickering, i don't see any reason why this should?
if you implement this, you don't need the keypress event handler and it will provide the same function.
there may be other ways to implement this as well.
regards
|
|
|
|
|
That looks very helpful indeed thanks alot brother
Rocky
|
|
|
|
|
shyagam wrote: if (e.KeyCode != Key.Decimal || !Text.Contains("."))
base.OnTextBoxKeyDown(sender, e);
Can u plz tell me where this Text is Comming from... (!Text.Contains("."))
???
|
|
|
|
|
It was inherited from the NumericUpDown class.
It's the same if you would write "this.Text ", but the "this " keyword is redundent here.
Shy.
|
|
|
|
|
oh Sorry I was confused bcz I wasnt showing in the designer and neither it was available to Intellisense So i thougt it wasnt there at all.
|
|
|
|
|
can that copy paste issue be resolved in the same manner?
|
|
|
|
|
how can i display all the drive and files in the tree view control.
Jayesh Talsaniya
|
|
|
|
|
This article[^] might help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
In my app (using WPF) I have a side bar displaying a bunch of option.
I display the option with a list box and some databinding on the selected item.
now it's a sidebar, and when there are a lot of item, the scroll bar on the side is ugly, I would like to replace it with someting like that[^].
i.e. instead of having a scrollbar on the right, I want to have up and down arrow at the top and bottom.
Any suggestion on how to achieve that?
is there an object more appropriate that a list box?
Any XAML code example welcome!
|
|
|
|
|
Hello everyone,
First of all let me take this opportunity and thank you all guys for helping out.
I was wondering if it is possible to have a TabControl without the Tab avaliable for clicking and changing the page. I know I might sounded from lala-land when I said a TabControl without the Tab to change page, but I am plaing to change the page programitically. )
I have come across this article which any way does what I am looking for.
http://www.codeproject.com/useritems/WizardFromTabs.asp[^]
But I was wondering if there is any better way to have this done. To be honest with you, I don't fancy using a Panel to hide the Tab of the TabControl in order to stop the user from clicking on it.
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Hello,
So do you whant to hide the Tab, or do you just whant to prevent the changing of the Tab?
All the best,
Martin
|
|
|
|
|
Hello Martin,
Thanx for the reply. Well, I wish to hide them and take the privilage of clicking the tab away from the user.
As you might have noticed, I am trying to have multi-pages which are accessed programitically rather by clicking the Tab.
Thank you very much and have a great day.
Khoramdin
|
|
|
|