|
While creating C# Class Library (DLL) Using Visual Studio .NET, once we have created the dll file, then if we want to use the dll file in someother projoect then I have to add it as a reference by Project->Add reference. I was wondering if I have to do it everytime I create a new client program or just I have do it once and then in each client project/program I can call the namesapce by
using mcMath; \\ Assuming that my dll is called mcMath
|
|
|
|
|
You would stil have to add the reference to each application that you wrote that uses this .DLL.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can I create an installer which installs itself and I don't need to add it as a reference always?
Regards and Thanks a lot,
Amit
|
|
|
|
|
There's no such thing. The only way to get this functionality is if you modify the project templates to include your reference in the default list of references for that project.
There's no such thing as just typeing using ... and having the reference automatically made. The only reason you think you see this is because the namespace that your using is part of an existing reference.
Try it, create a new C# application, but don't add anything to it. Look under References and you'll see that there is a default set already made. Look in the Object Browser and you'll find that every namespace under those references (the .DLL's) is available just by typing using ... at the top of your code. But this exists ONLY because the references have already been made.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My software (C# Winform) need to connect to a website to download a file.
The file is sought on the website with the login and password, then given to the client to download.
If I try with the browser, the website gimme a page with the password and the login and a "Connect" button.
I would like to emulate that work, without using the browser.
I'v no problem to connect to the Url and to download, but don't know how to send the login and passwor. I've try the code below, but it doesn't work.
<br />
MyLogin = "Me"; <br />
MyPassword = "11111111"; <br />
MyUrl = "http://mySite.com/MyPage.php"; <br />
clsDownLoadFile MyDownload = new clsDownLoadFile(); <br />
clsDownLoadFile.htmlStream MyStream = new clsDownLoadFile.htmlStream(); <br />
MyStream = (MyDownload.FindUrl (MyUrl, MyLogin, MyPassword)); <br />
if (MyStream != null) <br />
{ <br />
if (MyDownload.IsWebConnected()) <br />
{ <br />
string s = "login="+MyLogin+"+passwd="+MyPassword; <br />
WebClient myWebClient = new WebClient(); <br />
Stream postStream = myWebClient.OpenWrite(MyUrl,"POST"); <br />
postStream.Write(postArray,0,postArray.Length); <br />
postStream.Close(); <br />
try <br />
{ <br />
myWebClient.DownloadFile(@"C:\Temp", "MyFile.zip"); <br />
} <br />
} <br />
} <br />
I catch an exception when trying to download. I thought beacuse the Identification on the server doen't accept me.
Could someone help me, I drown...
|
|
|
|
|
no expert opinion on my problem?
|
|
|
|
|
Hello,
I have a progress bar and i have the min set to 1 and the max set to 100. I want to be able to click on part of the progress bar and for the progress bar to go to the value that l click on in the progress bar.
For example if the progress is on 10, and l click on the bar in the area of about 80, then the progress will go up to that value of 80.
Many thanks in advance,
Steve
|
|
|
|
|
Weird usage of a progress bar... but you can handle the mouse down and check where the click occured. Based on the location and the size of the progress bar you can determine the value to set.
Alex Korchemniy
|
|
|
|
|
You'd have to handle the MouseDown event of the Progress control. In there, you would get the mouse coordinates where where the user clicked the mouse button. Call the control's PointToClient method with those mouse coordinates to get the point mapped to a usable point in the control. You then have to do some math to determine how far from the left side of the control the user clicked the mouse, then map that number to a value between 1 and 100 so you can set the appropriate value in the ProgressBar's Value property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
steve_rm wrote:
I have a progress bar and i have the min set to 1 and the max set to 100. I want to be able to click on part of the progress bar and for the progress bar to go to the value that l click on in the progress bar.
Why not use a TrackBar instead?
Roy.
|
|
|
|
|
Process.Start appears to only be able to start a process on the same machine.
Is there a way to start a process or preferably a php program on a remote machine.
What I want is to call a php on the server from a C# program on a workstation.
Regards,
Alf Stockton
|
|
|
|
|
StrayGrey wrote:
Process.Start appears to only be able to start a process on the same machine
True. Otherwise this is a HUGE security risk.
StrayGrey wrote:
Is there a way to start a process or preferably a php program on a remote machine.
You would need to use WMI and the System.Management namespace to launch a remote executable. You'd also need to provide credentials to an account that has administrator rights to the target machine.
Win32_Process[^] WMI class, Create method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i just want to know if i make an applet i mean like java applet and integrate it with html or php to a web page (not using asp.net) now for any client using that applet must have .NET frame work installed but does the server must also have .NET framework installed. i think U understand my question :s
|
|
|
|
|
Yes, your client must have the .NET Framework installed for it to run. If your server is going to be executing managed (C#, VB.NET, Managed C++, ASP.NET) code server-side, then the server has to have the .NET Framework installed also.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
so you mean .. if i make a game in C# only client side and i use php on server side both clients need to have .NET framework installed but server doesn't neeed to.
thax man ..
|
|
|
|
|
True.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In addition to what Dave said, keep in mind that you can only do limited things when running an "applet"; i.e. you can't delete files on the client system, or access the registry, and so on. Doing so will result in a SecurityException. Look up Code Access Security in your favorite search engine to learn more.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality for Christ! Yeah!
Judah Himango
|
|
|
|
|
How can i access parallel or serial ports in C#.
if anyone knows please tell me as early as possible.
arsaldear
|
|
|
|
|
|
Hi,
I am having various controls say... Estimated Start Date, Estimated End Date(both are text fields with date)
How can I perform these validations using Asp.net Validation Controls
1) If I input Estimated End Date, it is compulsory for me to input Estimated Start Date, other wise it can be left empty.
2) Estimated Start Date >= Todays date (if i input it)
Please Help me..
Thanks
|
|
|
|
|
i have two forms...in first form, i have menuitem, on whose click i shld display second form. Also i have two menuitems, when i click either of them i should see the same form, but the label should be different ..like if i click on menuitem1 , the label must have value "from" and if menuitem2 is clicked, then the label should have value "to"...
i want to create property for label...so can you tell how to do it...and where to create?
also how to write this property...ne help will be appreciated...
|
|
|
|
|
private System.Windows.Forms.Label lbl = new Label();
public string ChangableLabel
{
set{this.lbl.Text=value;}
}
private void menuItem[i]_Click(object sender,EventArgs e)
{
form2 f = new form();
f.ChangableLabel = "Some text";
f.Show();
}
|
|
|
|
|
yes it worked..thanks
|
|
|
|
|
thanks
|
|
|
|
|
i'm new in using c#
I need to convert what on the panel to bytes.
I ask u before
u told me to use getpixel
i really don't know how to use it in what i want
so if u can help me or tell me where can i find examples it will be so great.
thx alot
|
|
|
|