|
I seldom recommend a specific book as it depends on your personal taste, and your prior knowledge about programming in general, other languages, etc. I normally suggest one visits a real (or virtual) book store, looks at 5 or 10 books, and buys 1 or 2. It has been a long time I learned about .NET and C#, I then was quite happy with the Microsoft Step by Step series of books.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Welcome to CP, and to C#, Ravi.
I've been working at learning C# myself, and I've found Professional C# 2005 with .NET 3.0 by Wrox Press very helpful. It is not, by far, a perfect text, but it's taught me a lot, and my friends here at CodeProject regularly supplement my knowledge.
Will Rogers never met me.
|
|
|
|
|
Charles Petzold has written a great introductory book which you can find here[^].
The best things in life are not things.
|
|
|
|
|
SFORavi wrote: Convert.ToSingle
Other than ChangeType, never use the Convert class -- there is always a better way.
|
|
|
|
|
PIEBALDconsult wrote: Other than ChangeType, never use the Convert class -- there is
always a better way.
For example?
|
|
|
|
|
SFORavi wrote: I am moving from mainframe to C#.
And are you moving from procedural programming to Object Oriented programming as well?
If yes then note that you will need to think differently about designing code. It is not just a matter of understanding the syntax.
|
|
|
|
|
i want to control my network adapter with my pro
can i disable and enable it or can i control internet access with my pro ?
if you can , i don't want to use API methods
tanks
MM
|
|
|
|
|
MohammedMahmoud wrote: can i disable and enable it or can i control internet access with my pro ?
That probably depends on exactly what you mean.
From the technical standpoint you do not "have" internet access. What you have is the ability for your IP traffic and probably more specifically TCP requests to reach other computers (of which those compose the internet.)
And denying access to that depends on your exact network setup. So for example if you have a typical home setup with a desktop and and cable modem then you would want to configure the cable modem to stop allowing traffic to and from external IP sources. That would leave local traffic still working but the internet would not be accessible.
However to do that you must interact with the cable modem box and there is no specific fixed way to do that.
Conversely if you are talking about creating a firewall via C# then that is a different solution as well.
MohammedMahmoud wrote: if you can , i don't want to use API methods
Then no.
The term "C#" is used to refer to both the language and the .Net API. And like most or perhaps all languages you cannot not do any real work in the language without using 'libraries' that come with the language. For C# that is the .Net API.
Myself when I want to disable network access, which is not the same as internet access, I use Process to run the 'ipconfig' command with the '/release/' option. Of course it is a good idea to set it back up again.
|
|
|
|
|
ok friend
just try to give me a solution
i want to click button in my application to disable the network adapter , and other button to enable it
i want to control the network adapter
thanks
|
|
|
|
|
As I said....
Myself when I want to disable network access, which is not the same as internet access, I use Process to run the 'ipconfig' command with the '/release/' option. Of course it is a good idea to set it back up again.
The name of the class is 'Process'.
The commands are
ipconfig /release
ipconfig /renew
You should try those commands yourself before programing them.
|
|
|
|
|
I don't know the details, and they might vary with your operating system and PC configuration, however I think there are two ways to get that.
1.
using WMI, not sure which classes, and probably not the easy way.
2.
through a "DOS command". First figure out which command line would do what you want when typed into a DOS Console (a "Command Prompt"). Then have your app execute that DOS command, which for "dir args" would look like:
Process.Start("cmd.exe /C dir args");
HTH
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I haven't tried this myself, but one of my co-workers was trying to do the same thing (enable/disable the network adapter, and turn DHCP on/off in C#). Turns out for some network-related tasks, WMI will work in either Win7 or XP, but not the other, and he had to hack the registry when WMI didn't work. WMI was very helpful with a nice generic error message (don't remember what it was exactly, but basically just said "Oops, that didn't work!").
As for the WMI classes, I think he used the Win32_NetworkAdapterConfiguration[^] class.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Seek[^] and ye shall find.
The best things in life are not things.
|
|
|
|
|
Hello experts,
I have a asp.net website with c# as behind file code and also a win form app.
I would like to ask, how can my asp.net website get the database records of my win form app in my local machine?
I'm able to receive the database records coming from my website to my win form app here at my local machine using web service but sending my database records to my website is confusing me.
Any help is kindly appreciated.
Thanks,
DAN
|
|
|
|
|
one normally stores the database and the web site on the same machine (or machine cluster). That is why the typical web host will offer PHP+MySQL facilities, or ASP.NET+SQLServer, or whatever combination makes sense to the market.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hello,
Thanks for the reply. Seems my last resort is to really host my own website to my local machine.
|
|
|
|
|
I trust there are ways to keep site and database apart, however I see lots of disadvantages. Why can't you have a database where your site is? If that really is the case, I would consider switching web hosts.
Having your own host is a pain, you need to provide hardware and software, have a fixed IP address and sufficient bandwidth, probably organize redundancy for reliability, organize backups, maybe a help desk, etc. There are thousands of web hosts all around the world, and a lot of them are free. Use Google to find out, this[^] is just one I stumbled upon.
BTW: you probably are best served by a host you pay for the service. My site is hosted here[^], for some 80 euro a year.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hello,
My reason to connect my website to my local database is to sync the two database from my local machine database and the database I upload also from the site. I can get some database records coming from my website and use the records to update my back end program using web service of asp but a big problem came that my back end program could not sent its database records to my website
By the way my website was a simple online registration for school and the back end program is the offline part its a school project of mine and kinda cramming because few months left before the deadline.
Thanks also for the link on the free hosting site I might give it a try.
Thanks,
DAN
|
|
|
|
|
OK, you want a remote backup.
This is what I do manually:
- I have a local database on my dev machine, and a similar one at ny web host;
- I transfer tables (never the entire DB), from one to the other using PHPMyAdmin; "export" creates a text file, filled with SQL commands that could delete and recreate an entire table; "import" would execute such file, hence dropping the existing and creating the replacement table.
Of course there could be very good reasons to automate this. Haven't done that yet.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hello,
Thanks again for that great help, would you mine if you could show how will I do that using asp
Thanks again,
DAN
|
|
|
|
|
Sorry, I don't know for ASP and SQLServer, I do it with PHPMyAdmin which is for PHP+MySQL.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hello,
Thanks still for the great idea. I will try and hope I can do it with asp using the idea you give me.
Thanks,
DAN
|
|
|
|
|
It is actually entirely possible to do what you are trying to do. Most large companies do not host the database and the web server on the same physical server. It is best practice to have them at the same location so they can be on the fastest possible network however.
First make sure you have a static IP Address where you wish to host your SQL server (you can also look at a dynamic IP solution more complex though)
Open the port for your chosen SQL software
Have you web service connect to the SQL server using the static IP Address from above.
I have done this before, several times, and results vary. You almost always want a very fast connection to your database, usually on the same LAN, sometimes it doesn't matter. You'll find out pretty quick.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hello,
Thanks for the great info. Would you mine if you could give me some a little help or info on how can my asp.net web service connect to the static IP where my SQL server is located. Kinda Google it almost everyday but still don't find some way on how to do it.
Thanks,
DAN
|
|
|
|
|
Hi,
I am trying to control the fan via relays and pc's parallel port.First time by running the c# code it turned on the fan but later on if i stop debugging of the program fan is not switched off.It is just swtiched off by unplugging the adapter. And second time whenever i plug the adapter it is turned on without running the program.It works by plugging the adapter just. I want to control it whenever i press the button in c# it is turned off and by pressing the other button it should be turned on. I dont know how to resolve this?? If any one knows then plz let me know.
Thanks in advance.
Regards,
Aeman
|
|
|
|