|
What's wrong with it ? Also, you can't make it more accurate than it is. I am sure it is accurate, it always has been for me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello and thanks for replying.
Well "personal information" is not in the same line.Moreover "Orders table" "for each order" etc.
I would like them to be in the same line and not wordwraped.
|
|
|
|
|
Every time it wraps, it's because there's not enough room to fit them. If the column has been sized to the biggest string ( you don't actually tell us what you do with it ), then perhaps you just need to add a few pixels ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for the replies.Well i just want to fit the text exactly inside the cells(table cells).I create a table(control provided) and set text inside its cells.Then i process all the cells and try to set the correct width(using measurestring).
How will i know that more pixels are needed to be added?
I will try the links provided but i don't know if they fit in my occasion.
Thanks again people.
|
|
|
|
|
Hi,
I've read before there are some slight inaccuracies, so I tend to add some 10 pixels to make strings fit.
This article will tell you more: Bypass Graphics.MeasureString limitations[^]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi, i have a windows service that needs to read files from mapped drive. The drive is located at \\networkshare\mynetwork. This path has a a folder named ConfirmedOrders. so i am trying to read as:
"file.readalllines(\\networkshare\mynetwork\confirmedorders\myfile.txt)" in windows service and i get an exception UnauthorizedAccess with msg "Access to path ... was denied".
I have another asp.net page which connects to same location and is able to read the file.
I have no idea why my service is not reading the file. The account that i am using for service is LocalSystem and yeah, the mapped drive has permissions for all users.
I tried switching the service to user account but that requires username and password and am not sure on wat the username and password should be. Tried assingning a username and password and i get a msg that "no mapping between account names and security Ids was done".
Any help would be greatly appreciated.
Thanx
|
|
|
|
|
I recently created a simple service that moves files, but it may be similar enough to be useful. It uses a P/Invoke of mpr.dll to create a share without a drive letter; I did this because I ran into the same access denied errors that you mention above.
Don't know if this will help or not, but it worked for what I was doing. Good luck!
private const int RESOURCETYPE_DISK = 0x1;
[DllImport("mpr.dll")]
private static extern int WNetAddConnection2A(ref structNetResource pstNetRes, string psPassword, string psUsername, int piFlags);
[StructLayout(LayoutKind.Sequential)]
private struct structNetResource
{
public int Scope;
public int Type;
public int DisplayType;
public int Usage;
public string LocalName;
public string RemoteName;
public string Comment;
public string Provider;
}
private void fileTransfer(string AbsoluteFilename, string FileName)
{
try
{
structNetResource stNetRes = new structNetResource();
stNetRes.Scope = 2;
stNetRes.Type = RESOURCETYPE_DISK;
stNetRes.DisplayType = 3;
stNetRes.Usage = 1;
stNetRes.RemoteName = destinationFolder;
stNetRes.LocalName = string.Empty;
int i = WNetAddConnection2A(ref stNetRes, destinationPass, destinationUser, 0);
if (i > 0) { throw new System.ComponentModel.Win32Exception(i); }
if (File.Exists(AbsoluteFilename)) File.Move(AbsoluteFilename, destinationFolder + "\\" + FileName);
}
catch (Exception ex)
{
throw new System.Exception(ex.Message);
}
}
modified on Monday, July 13, 2009 4:37 PM
|
|
|
|
|
Hi, Thankyou and wow!!!
First look through your code was confusing but ful of hope. I might need help though. Do i have to download mpr.dll? and also RESOURCETYPE_DISK (0X1)? also wat will be destinationPass,destinationUser.
I thought UNC makes things easy and though my drive letter was Y: , i was using \\xyx\\abc.
Thankyou again
|
|
|
|
|
Also, note that you may need to involve these namespaces:
using System.IO;
using Shell32;
using System.Runtime.InteropServices;
mpr.dll should be located in your Windows directory at the following location: C:\WINDOWS\system32. It's part of the OS. (I don't think that they changed it in Vista; I use XP.)
RESOURCETYPE_DISK is a constant hex value; you can use that line as-is.
destinationUser = "Domain\Username", e.g. @"MSHOME\Jane.Doe" or "MSHOME\\Jane.Doe"
destinationPass = The password for the user above.
destinationFolder = The path to the remote folder the user account has rights to. e.g., @"\\SERVER\ShareFolder" or "\\\\SERVER\\ShareFolder"
Note that the purpose of the code snippet given was to move a file from the local machine to a remote share. You would need to modify it slightly to open files instead. (Change the last line, right before the Catch block.) You don't need to provide a drive letter to use this code; I leave mine as string.Empty.
modified on Wednesday, July 15, 2009 12:16 PM
|
|
|
|
|
Could it be the user that is being set to run the service has no access to that folder?
|
|
|
|
|
Yeah, it was because of the user. I figured it out though. Thanx for replying.
|
|
|
|
|
Hi.
I've heard somewhere that openCV doesn't develop by Intel anymore ?
Is that true?
Thanks.
|
|
|
|
|
Does this have anything to do with C#?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
well, we can use OpenCV in C#
sorry if the question is out of the subject
|
|
|
|
|
I'm just being lazy, I could look it up for myself, but I have no idea what openCV is.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
It's an open source image recognition package. It was originally developed by Intel, but Wikipedia doesn't say who develops it now
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
It's gone Open Source here on sourceForge[^]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I am trying to get the contents of a pdf file as text in my C# .net program.
I am using PDFBox 3.0 for reading the pdf as text.
However, the problem is that the pdf file is not physically located on the
same machine and I am accessing it through a URL.
The PDFBox documentation shows that there is a static function which is of the form :
PDDocument load(URL url)
This will load a document from a url.
However, C# does not have a URL class but rather it has a URI class.
Can anybody suggest a workaround.
Or is there any other free tool that would help me achieve reading the pdf file
as text from a URL?
Any help would be appreciated.
Thanks,
Aakar.
|
|
|
|
|
If the method takes a URL, then it must provide a URL class, unless it just takes it as a URI or a string.
What do the docs say ? Are there samples ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
I am dynamically exporting data from asp.net page to excel format which works fine, but when I am exporting a float value 7.0 is being exported as 7 to the excel spread sheet. It is truncating the trailing zero and the decimal point.
Thanks,
vijju
|
|
|
|
|
I assume there is something wrong with your code. Hard to say what, without seeing it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Does a value such as 7.01 also get truncated to 7? If not, and 7.01 shows up as 7.01 in Excel, then this is probably just a case of the default number format in Excel being 'General' which will cause values like 7.0, or 7.00, etc., to show up as 7 in Excel.
|
|
|
|
|
Only values like 7.0 is being exported into excel as 7. if it is a default number formating, then how do you get around it, and just show the value as it is 7.0 in excel.
thanks,
vijju
|
|
|
|
|
That's likely only a formatting issue in Excel. What happens with non-integer values?
|
|
|
|
|
All the values are exported as string. if it is 7.01, it works fine. but if it 7.0, then excel shows it as 7.
Thanks,
vijju
|
|
|
|