|
thanX Luc,
the Process.Start(file,swtich) atually worked.
|
|
|
|
|
OK I searched google, msdn etc. but didn't find exactly what I need.
Can someone provide decent reference on this topic (hope detailed enough with best practice examples etc.).
Thanks!
|
|
|
|
|
|
Thanks... of
Bassam Saoud wrote: of links here [^] this one I already have 8/10 links visited (they are purple )... and on MSDN I know there is lot to read... but figured out their best text is for VB.net 2002, exactly one you posted right now actually... so although there is bunch of material I'm still not happy... but I'll keep searching.
Instead can someone say, how often we actually use n-tier architecture in day by day examples?
I know huge data-base things should be n-tier, but what about things that don't access net or some other shared resource?
how about n-layer?
|
|
|
|
|
Hi,
in my program i started a thread to do some work and i want to change the text on a Form in another thread. I always get an exception.
Could someone tell me what's the easiest way to do that? I read about delegates etc. Sounds NOT so easy
Thank you in advance.
|
|
|
|
|
Indeed, all operations on a Control (creation and modification) must be handled by a
single thread, normally that is the "UI thread". If another thread is involved,
you must use Invoke (or BeginInvoke) to launch the operation on the right thread.
There is a simple example in my article http://www.codeproject.com/csharp/LPSokoban.asp[^]
Look at the method pasteOneMove(): it is called by "thread" which is not the UI thread;
so pasteOneMove invokes itself, effectively making it run again, but this time on the
UI thread.
Luc Pattyn
|
|
|
|
|
Ah, thanks, now i understand
|
|
|
|
|
Hi, i search a livrary in Framework .NET 2.0 to see the resources of systems connected to my computer in my lan, but i didn't find it.
What is the library/method to see network resources of systems in my lan (like DriveInfo, DirectoryInfo etc... for local resources)?
Thanks and excuse me for my bad english!
|
|
|
|
|
Plz try this code.........This done with the help of WMI
using System.Management;
Private ManagementObjectSearcher OS;
Private ManagementObjectSearcher CS;
Private ManagementObject Mgmt;
OS = New ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");
CS = New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem");
For Each Mgmt In OS.Get
{
String OSName = Mgmt("name").ToString();
String OSVersion = Mgmt("version").ToString();
String ComputerName = Mgmt("csname").ToString();
String WindowsDir = Mgmt("windowsdirectory").ToString();
}
Next
For Each Mgmt In CS.Get
{
String strManufacturer = Mgmt("manufacturer").ToString();
String StrModel = Mgmt("model").ToString();
String strSystemType = Mgmt("systemtype").ToString;
String strTPM = Mgmt("totalphysicalmemory").ToString();
}
Next
Or u can also use
Environment
Environment.OSVersion.Platform like.....try other methods......
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Excuse me but i don't understand where i can find data about the drives of other systems connected to my pc.
Thanks for help!
|
|
|
|
|
I've used the exaple but i don't understand where i can see the others systems in my LAN . . .
|
|
|
|
|
I am having trouble changing icons. I edit them with the resource editor, but when I display them they haven't changed.
For instance, I'll add an icon to my assembly (Add New Item/Icon file). Then I change its Build Action Property to Embedded Resource. Then I edit the default to what I want. I retrieve the icon with:
Icon icon = new Icon(this.GetType(), "MyIcon.ico");
Lastly, I assign this icon to the Icon property of a StatusBar panel.
The problem is that the icon hasn't changed from the default image. No amount of saving, rebuilding, etc. seems to do anything. Viewing the image in the icon editor shows the changed icon. Viewing the file with a drawing program (e.g Paint) shows the changed icon. I just cannot get it to diaplsy on my form correctly.
What am I doing wrong?
Dave
|
|
|
|
|
Yes, I have had some trouble with that too.
An icon may contain several images, typically at different resolutions;
typically 16*16 and 32*32 would be present.
On Visual Studio 7.1 look at menu Image/Current Icon Image Types.
Which image of the icon file gets used depends heavily on circumstances;
it may be different for:
- the task bar button
- the form's icon
- Windows Explorer showing small icons
- Windows Explorer showing large icons
Furthermore, Windows Explorer sometimes caches the icons used in a folder
(I am not sure, maybe in Thumbs.db which may be invisible, depends on your settings).
So when designing an icon, you should edit all images it contains,
and you may want to delete the icon cache file if you can find one.
Luc Pattyn
|
|
|
|
|
Thank you, this solved most of my problems.
I must say that all this is not very intuitive. Multiple icons in one file? Also, it would be nice if the IDE's Icon Editor displayed all the images in the file or gave you a hint that there may be more than one. Oh well.
Another question: You mentioned that the icon plucked from the file depends on circumstances. Is there any way of extracting a specific icon from a file? For instance, I get the icon with:
statusBarPanel.Icon = new Icon(this.GetType(), "MyIcon.ico");
This seems to look for the 16x16 icon. What if I had a circumstance where I wanted a specific size (color...) rather than the default?
Thanks,
Dave
|
|
|
|
|
Well, all those images together form only one icon, so you better make sure they all
look alike.
I know of no way to pick a specific image from an icon.
If you want to pick a specific icon from many, keep them well apart, i.e. in separate
files, or in separate resources.
BTW there also exists a way to pack multiple icons (each possibly with multiple images)
into a single file, I have forgotten all details tho. Maybe its called an icon list ?
Luc Pattyn
|
|
|
|
|
I think your problem is that you are calling "MyIcon.ico" so it's looking for that file in the current directory. If you are embedding the ico as an ebedded resource it won't be there.
You'll need to use Reflection to get the embedded Icon.
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream stream = assembly.GetManifestResourceStream("WindowsApplication3.Icon1.ico");
Icon icon = new Icon(stream);
this.Icon = icon;
|
|
|
|
|
if you hav ur icons on the resource manager, it is easy to pic the icons. VS hav some built in functions for that
use the following code.. (not tested)
statusbar.Icon = global::namespace.Properties.Resources.icon;
namespace - give your name space name.
icon - name of the image added in the resource manager.
hope this helps
|
|
|
|
|
Hello everyone!
My VS crashed for the first time like 2 or 3 days ago when I was working. I got the Microsoft error reporter and everything. I reopened VS and it crashed again. I opened it a third time and it said it skipped document loading because last time there were errors.
So I had a rest from that project. Today *, I re-opened it, and everything seemed to work fine. However, when I tried to open Form1.cs in design mode, the program disappeared... No error, no nothing, just showed my desktop... I noticed a little icon in the system tray, but it went away as soon as I hovered it with the mouse...
Everything else works, code view for that same file doesn't have any problems, I can open another form in both modes and it works fine too... I tried excluding the file from the project and re-adding it, doesn't work...
The app closes so fast that it surprised me... You know like, it always takes a while to show the error before it crashes...
Anyone know what's wrong? Thanks!
* I'm not sure if this is relevant or not... But, after the "rest" I had from this project, I moved it to my new flash drive.
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: I noticed a little icon in the system tray, but it went away as soon as I hovered it with the mouse...
A NotifyIcon that does not get Disposed() acts exactly like that.
I have had some trouble when using two versions of Visual working inside the same folder,
when I tried to develop and share code for both .NET 1.1 and 2.0
I frequently have to delete the entire obj folder (when trying to use Visual 7.1 after
Visual 8.0 did a build).
And sometimes I have to explicitly "Rebuild Solution" when a small mistake ends up in
dozens of error messages, that otherwise dont go away when the error got fixed.
So my suggestions: delete obj, and Rebuild solution.
Luc Pattyn
|
|
|
|
|
|
Nevermind, my custom control was broken...
Windows Calculator told me I will die at 28.
|
|
|
|
|
hi,
i want to know how a universal conection can be built so that my programe with a small dataBase
file can be opened on the others pcs as well without giving a new connection string.giving connection string at every other pc ,i want to avoid this.
|
|
|
|
|
You need the physical address of the database file to open the connection, but if you place the database file at the same relative position to the executable all the time, you can create the path by getting the path of the executable and add the relative path to the database.
---
Year happy = new Year(2007);
|
|
|
|
|
here is my app.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<dataConfiguration defaultDatabase="SqlConnection" />
<connectionStrings>
<add name="SqlConnection" connectionString="server=Developer;database=MSPetShop;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
first i m getting these two errors:
Message 1 Could not find schema information for the element 'dataConfiguration'.
Message 2 Could not find schema information for the attribute 'defaultDatabase'.
and when i try to call the from my DAL layer i got exception
i m using this funcion
Database db=DatabaseFactory.CreateDatabase();
I hope any one there will reply me many thanks,
adnan
|
|
|
|
|
Hi,
Please make sure that the assembly and the project name specified in the configSections of the app.config is same as what you have in your project.
Thanks
Rakheesh
|
|
|
|