|
|
my app is at(root):
C:\Documents and Settings\wolf\My Documents\Visual Studio 2008\Projects\MyMoO\Client\bin\Debug
my resources are at:
C:\Documents and Settings\wolf\My Documents\Visual Studio 2008\Projects\MyMoO_Resources\stars
and i'm accessing them with latter path, however, if i would archive MyMoO & MyMoO_Resources and unarchive them to another path i would have to edit the path in source. I need to give it a relative path approach.
My problem is that i don't know how the relative path for the resources would look like in this particular case(URI above)
I found this helpfull link however i don't know what my relative path would look like, i might even be able to hard code it.
http://weblogs.asp.net/pwelter34/ar...de-snippet.aspx
Even so if that' the right method for me then what do i pass it as fromDirectory and toPath arguments? Root and resources paths?
I tried first hardcoding stuff like @"..\..\..\MyMoO_Resources\stars" but it didn't work.
modified on Friday, August 22, 2008 10:17 AM
|
|
|
|
|
private string GetResourcesPath()
{
string basePath = AppDomain.CurrentDomain.BaseDirectory;
string commonPath = basePath.Remove(basePath.Length - @"MyMoO\Client\bin\debug\".Length);
return (commonPath + @"MyMoO_Resources\");
}
|
|
|
|
|
Hy everyone!
I used the itextsharp dll http://itextsharp.sourceforge.net/examples/Chap0607.cs ccomponent to add images to a pdf document. In default it uses the squar format for the page. I didn't change this, but no matter which size i choose the pic to be or which parameter I try to use to set the location where the pic is located at, there is a white strip on top of the page. is there a chance to use 100% of the page?
my code is
Document document = new Document(PageSize.A4.Rotate());
try
{
PdfWriter.GetInstance(document, new FileStream(outputPath, FileMode.Create));
document.Open();
for (int i = 0; i < list.Count; i++)
{
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(list[i]);
if (img.Width >= img.Height)
{
img.Alignment = iTextSharp.text.Image.MIDDLE_ALIGN;
img.RotationDegrees = 0f;
}
else
{
img.Alignment = iTextSharp.text.Image.MIDDLE_ALIGN;
img.RotationDegrees = 270;
}
img.ScaleToFit(855, 550);
document.Add(img);
document.NewPage();
}
}
catch (System.Exception EX)
{
logger.Error(EX.ToString());
}
finally
{
document.Close();
}
is there a chance to fit the pic into the page to use the whole size, so to get rid of the white strip on top (compareable to the orange bar on top to the rest of this page here)?
thanks!
stephan.
|
|
|
|
|
I have to fill a column in a datagridview with a default value, therefore I have defined a custom celltype:
public class BNummerCell : DataGridViewTextBoxCell
{
public override object DefaultNewRowValue
{
get
{
return NewCellValue();
}
}
}
From this custom cell I created a custom columntype:
public class BNummerColumn : DataGridViewTextBoxColumn
{
public override DataGridViewCell CellTemplate
{
get
{
return new BNummerCell();
}
set
{
//base.CellTemplate = value;
}
}
}
I have added a column of type BNummerColumn to my DataGridView, and new rows are supplied with a correct default value.
However, whenever I click on the new row, the default value dissapears and doesn't come back.
It must be simple, but I searched already over an hour....
Thanks in advance,
Rob
|
|
|
|
|
Hey guys
Im still battling with this crap!
this is a console app and sits in C:\windows\system32 . the reson being so that another program can access it via command prompt. When the caller program calls this exe i get the error message "CLR error: 80004005 program will now terminate".
If i move the app and its dll to the desktop it executes
im so confused... this works like a charm in XP
why is this happening? apart from vista being retarded
[update]
i wrote an hello world console app and put it in system32, targeted 3.5 and it worked fine. Im convinced it has something to do with the SDK (C++ wrapper) the app is calling. I still dont get how it works if i move it out of there.
also tried running as admin & played with the compatibility stuff
[/update]
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
modified on Friday, August 22, 2008 2:36 PM
|
|
|
|
|
Check which versions of .NET framework are installed.
This problem can occur if v2.0.50215 is installed (it was a pre release version)
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
only 3.5 shows in "Programs and features"
how would it execute after i moved it out of system32 if its a compatibility thing? im so confused with this
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Check the framework folder - not sure where it is on Vista, on XP it's C:\WINDOWS\Microsoft.NET\Framework - there's a folder in there for each version.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
found it, its got...
V1.0.3705
V1.1.4322
V2.0.50727
V3.0
V3.5
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Looks OK
It may be worth uninstalling all of them and then re-installing the ones you need.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
all but 3.5 is "built in" vista, AFAIK there isnt an easy way to uninstall it
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hmmm... Maybe this blog[^] can help?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Thank you dave, ill try it monday morning
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Try taking over permissions of that file.
Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO. In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard. Chuck Norris actually owns IBM. It was an extremely hostile takeover.
|
|
|
|
|
hey
i just updated the original message...
what do you mean by taking over permissions?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Thought is was worth a shot, any ways you right click a file, click properties, click the security tab, click Edit and change the permissions in your favour.
Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO. In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard. Chuck Norris actually owns IBM. It was an extremely hostile takeover.
|
|
|
|
|
The Default access specifier for the class members in C# is Private
and
The Default access specifier for the class in C# is Internal
Are these statements correct ......
Actually somewhere i read tht "The Default access specifier for the class members in C# is Internal
Plz suggest me ????
|
|
|
|
|
|
Yep u r right,
Always Class is internal and member variable pertaining to that class are private in C#.
Regards,
Rohan.
|
|
|
|
|
Hi,
I hv my datagrid in a table,which includes labels also..I am exporting the whole table(Datagrid,labels)to excel.The labels are displayed randomly,but when i run the application it displays correct,but when exported to excel they r arranged in random fashion..
Pls can anyone help..
Thanks & Regards
Annu
|
|
|
|
|
Check the code where you exporting data to excel ?
|
|
|
|
|
Hey here is my code...
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "application/ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=MonthWise.xls");
Response.Charset = "";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
tb.RenderControl(hw);
Response.Write(sw.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control Control)
{
}
Here tb is my table which i am exporting...
|
|
|
|
|
where is the code for label ??
|
|
|
|
|
My labels are in table..its id is tb
|
|
|
|