|
Provo kete
www.java2s.com/Code/CSharp/2D-Graphics/Shapes.htm
|
|
|
|
|
|
|
I'm curious if anyone has found a way arround it. I've got a dll built with the beta of c# VS.Net 2005. I want to add that dll as a reference in a vs.net 2003 project but i get the classic "could not be added. this is not a valid assembly or COM component. only assemblies with extension 'dll' and COM components
can be references. Please make sure that the file is accessible, and
that it is a valid assembly or COM component." error.
anyone found a way arround this, or am i trying to do the impossible?
|
|
|
|
|
There's a good chance you're trying to do the impossible, since the 2005/.NET 2.0 dll may have references to or exposes 2.0-specific functionality (such as generics) which are not supported in 2003/.NET 1.1.
|
|
|
|
|
The problem is even more straight forward than that. Because 2.0 introduced such items as generics it required the Metadata format to be updated. This new format is not backwards compatible with 1.0 and 1.1. Such the 1.x versions of the frameworks cannot load your 2.0 dll irrespective of what type of code you actually wrote in the dll.
However it is possible fon a 2.0 DLL/APP to reference a 1.x DLL
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Is there a way to determine whether an installed print driver (as shown in PrintDialog) is for a printer or a fax? PrinterSettings doesn't seem to provide that kind of information.
cobra2005
|
|
|
|
|
Okay, not sure on this, but give it a shot. (I don't have a fax hooked up to any printer....) Put the following in a Console Application and run it to see if you get what you want. If a "printer" is fax capable, then hopefully you will see it in the CapabilityDescriptions property. You need to add a reference to the System.Management.dll in your project.
ManagementClass c = new ManagementClass( "Win32_Printer" );
ManagementObjectCollection moc = c.GetInstances();
foreach( ManagementObject mo in moc )
{
string name = ( string ) mo.Properties[ "Caption" ].Value;
string[] desc = ( string[] ) mo.Properties[ "CapabilityDescriptions" ].Value;
Console.WriteLine( "{0}", name );
foreach( string s in desc )
{
Console.WriteLine( "\t{0}", s );
}
Console.WriteLine();
} If you don't see "Fax," or something like that, then iterate over all the properties of the ManagementObject and see if you can find something in there.
Hope it helps.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks Curtis. I need something more "robust". though. There is no capability listed for a fax driver and I can't use the driver/printer name because of localization issues (the app should be designed to work in other countries, as well).
cobra2005
|
|
|
|
|
Thanks Curtis. I need something more "robust". though. There is no capability listed for a fax driver and I can't use the driver/printer name because of localization issues (the app should be designed to work in other countries, as well). Any other ideas? I've also tried Win32 API EnumPrinters with no luck.
cobra2005
|
|
|
|
|
I want an event that is fired when a particular textBox on a DataGrid is loses focus.
Day by Day Everyone is moving towards graveyard
|
|
|
|
|
sorry, cant get my brain working this morning.
the logical question I need my program to figure out is :
The X day of every Y month(s) with a Startdate of Z and a (Enddate of W OR occur V times)
this is my start:
<code>string matchpattern2 = "(0[1-9]|[12][0-9]|2[08])";
Regex re2 = new Regex(matchpattern2);
if(re2.Match(monthly1TxtBox1.Text.ToString()).Success == true)
{
int intDays = 0;
TimeSpan tsWeekly = endDateTime.Date.Subtract(startDateTime);
intDays = tsWeekly.Days;
DateTime[] datearray = new DateTime[intDays];
for(int x=0; x<intDays; x++)
{
datearray[x] = startDateTime.AddDays(x);
}
Array.Sort(datearray);
//DoTheWork
}</code>
anyone experienced with doing something like this?
-- modified at 9:06 Tuesday 20th December, 2005
|
|
|
|
|
What are you trying to do? Skimming over your code (use pre tags next time), I can't make out from your code what you're trying to accomplish.
|
|
|
|
|
Judah Himango wrote: What are you trying to do?
On the X day of every Y month(s) with a Startdate of Z and a (Enddate of W OR occur V times) i want to doSomeWork()
Judah Himango wrote: I can't make out from your code what you're trying to accomplish.
sorry, basically all i've done so far(in the code i posted) is make an array of DateTime's between the start and end date.
|
|
|
|
|
I think I figured out my issue. Here is my code for anyboday else that needs to do the same.
int dayOfMonth = Int32.Parse(monthly1TxtBox1.Text);
int iterativeMonths = Int32.Parse(monthly1TxtBox2.Text);
string matchpattern2 = "(^1?[1-9]$|^[1-2]0$|^2?[1-8]$)";
Regex re2 = new Regex(matchpattern2);
if(re2.Match(monthly1TxtBox1.Text.ToString()).Success == true)
{
int intDays = 0;
TimeSpan tsWeekly = endDateTime.Date.Subtract(startDateTime);
intDays = tsWeekly.Days;
DateTime[] datearray = new DateTime[intDays];
for(int x=0; x < intDays; x++)
{
datearray[x] = startDateTime.AddDays(x);
}
Array.Sort(datearray);
int loopcounter = 0;
int intRecur = 0;
if(occTxtBox.Text.Length > 0)
intRecur = Int32.Parse(occTxtBox.Text.ToString());
int occurNum = 0;
for(int x=0;x < intDays;x++)
{
if(intRecur == 0)
{
if(datearray[x].Day == dayOfMonth)
{
if(loopcounter == 0)
{
//DoWork
loopcounter = loopcounter + iterativeMonths+1;
}
else if(datearray[x].Month == startDateTime.AddMonths(loopcounter).Month)
{
//DoWork
loopcounter = loopcounter + iterativeMonths;
}
}
}
else
{
if(datearray[x].Day == dayOfMonth && occurNum < intRecur)
{
if(loopcounter == 0)
{
//DoWork
loopcounter = loopcounter + iterativeMonths+1;
occurNum++;
}
else if(datearray[x].Month == startDateTime.AddMonths(loopcounter).Month)
{
//DoWork
loopcounter = loopcounter + iterativeMonths;
occurNum++;
}
}
}
}
msg.Text += "<font color=red>Task Added</font>";
posAddEdit = 0;
}
else
{
msg.Text = "<font color=red>Please enter a day between 1 & 28</font>";
}
p.s. pre /pre always eats my for loops
-- modified at 18:23 Wednesday 21st December, 2005 0;
if(rmConn.State == ConnectionState.Open)
rmConn.Close();
}
else
{
msg.Text = "<font color=red>Please enter a day between 1 & 28</font>";
if(rmConn.State == ConnectionState.Open)
rmConn.Close();
}
p.s. pre /pre always eats my for loops
|
|
|
|
|
Joshua Lunsford wrote: string matchpattern2 = "(0[1-9]|[12][0-9]|2[08])";
I am not quite sure what your regular expression is supposed to match on.
0[1-9] matches 01 through 09.
[12][0-9] matches 10 through 29.
2[08] matches 20 or 28. This is already covered by previous.
Do you want it to be 3[0-8]
Also, as it is, this RE will match number in a larger string. For instance, the following string will match on the 20:
34562055
If you only want two characters, try:
(^0[1-9]|[12][0-9]|2[08]$)
Roy.
|
|
|
|
|
i want it to match on 1-28
|
|
|
|
|
Joshua Lunsford wrote: i want it to match on 1-28
Try this:
(^0[1-9]|1[0-9]|2[0-8]$)
PS. Sorry for taking so long. Holidays and all...
Roy.
|
|
|
|
|
Hi Friends
i m having some text fields in page & datagrid. when i click bookmark link, the page as to go up & it as to display from Data Grid.
If any one knows plz tell me the code( in java script or c-sharp code).
Thanking u
bye,
Naren
please help me
|
|
|
|
|
Hello,
I am accessing a shared file through UNC address over LAN. Whenever I do that, the windows login prompt appears. I need to bypass this prompt though C# code. How can I do it?
Regards,
Zishan
|
|
|
|
|
\\server-name\directory\filename
Just try with this, if possible u can get it.
please help me
|
|
|
|
|
Thanks for the reply.. yes right but then I try to access file like this.. a windows login prompt appears and I have to enter username and password manually.. I want this manual thingi to be handled by code. Some way to enter this Windows Authentication.
Regards
Zishan
|
|
|
|
|
Have you tried using System.Diagnostics.ProcessStartInfo? With that, you can supply a user name & password through code, but I don't know if this will work for UNC shares.
|
|
|
|
|
You can try Judah's suggestion. I don't know if it'll work either.
But, if it doesn't, a workaround I know of would be to temporarily map a drive to the share. You can most definately supply the username and password to that.
But, to clarify, there is NO WAY to get around that login box. The machine your connecting to wants to know who is trying to get into that share. That target machine doesn't trust the credentials that your app is running under. There is simply no way of getting around that. But, if the credentials are supplied using a different method, that box won't show up.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks both of you.. I am off from work now.. will try Judah's suggestion tomorrow.
Dave what credentials are you talking about.. can you please elaborate a bit more.. Let me be more precise. I have an application running on Windows XP Professional trying to access a shared file located on a network drive which is running Windows Server 2000. What's that "other method" Can you elaborate?
Thanks
Zishan
|
|
|
|