|
You're welcome
|
|
|
|
|
Hello everyone there,
I have following two problem with vb.net2005
1. I am trying to create a setup file for my application. I created the setup project(by adding setup and deployment project to my existing workspace),and without making any change(or chacking any option) I build the setup project. But when I try to install the created SETUP exe it pops up an error "the folder path '.' contains an illegal character"
Could anyone please help me out with the problem.
2. Also please give me the basic option to select (or to take care), while deploying a project. I am using vb.net2005 with crystal report.
Thanks in advance
I am a learner Always
|
|
|
|
|
|
Do not cross-post. It's considered rude.
|
|
|
|
|
I'm working on a utility that will allow the user to query some data from a database and output it.
I would like to support allowing the user to provide a format for the numbers, particularly if hexadecimal representation is desired.
Ideally I could simply do ((System.IFormattable) datarow [ columnname ]).ToString ( format , null ) , but when hexadecimal is requested the user may (should) want to tack on a leading "0x" and I've been unable to form a format that will do that.
What should work is "'0x'X4" , the '0x' should be copied to the output and then the value should be formatted with X4.
From the documentation:
"
'ABC' "ABC"
Literal string
Characters enclosed in single or double quotes are copied to the result string, and do not affect formatting.
"
Bull-pucky; they do affect formatting, they screw it up!
The closest I've gotten is string.Format ( format , datarow [ columnname ] ) with a format of "0x{0:X4}", but the user shouldn't need to specify the braces and such.
I'm considering using a Regular Expression and pre-processing the format to remove literal text before passing it to ToString, and concatenating the thing back together afterward.
I'm hoping someone here has a better solution.
|
|
|
|
|
The format characters you use should be enclosed with {}. I think there's nothing you can do about it.
I think the main question is what kind of options do you want to offer to the user? For example if you want to use syntax like:
"Hex, 4"
That would be converted using something like the following (with proper checks for the syntax):
If (format.StartsWith("hex", StringComparison.InvariantCultureIgnoreCase)) {
formatString = string.Format("0x{{0:X{0}}}",
int.Parse(format.Substring(format.IndexOf(',') + 1)))
}
|
|
|
|
|
Mika Wendelius wrote: enclosed with {}.
That's only with string.Format and its ilk. Which, as I said, works, but isn't ideal; the user would need to know too much about the internal workings of the program.
I could also just not support hex; after all, the database won't display the values that way.
I could also not allow a width specifier.
I could have hex and width specified separately.
On the other hand, this is just one simple utility; in the future I may have a project that really requires this.
I'd much prefer to use ToString and allow the user to specify "any valid Custom Numeric Format String[^]"
That should offer the greatest flexibility with the least intervention on my part. And it should work, according to the documentation.
I'll investigate my RegularExpression idea some time today. Thanks for your response.
|
|
|
|
|
PIEBALDconsult wrote: And it should work, according to the documentation
I'm pretty sure it works. Although I haven't used it so that the user gives the format, I read the format typically from database and it works fine.
PIEBALDconsult wrote: I'll investigate my RegularExpression idea some time today
Possibly the best way to go.
PIEBALDconsult wrote: Thanks for your response
No problem.
|
|
|
|
|
Mika Wendelius wrote: I read the format typically from database
For this utility I'll get it via XML file, but the user who creates the file should be able to specify what he wants without knowing much about the internal plumbing.
An added bonus to how I envision working around this problem responding pro-actively to this opportunity is that I can allow multiple sub-formats in the format.
With string.Format I can use "{0:X4}={0}" to format the same value into the output twice, but ToString doesn't seem to support that on its own: 20.ToString ( "X4'='0" ) results in X4=20 .
But if I pre-process the format, I can add support that I feel ToString should have; split the format into { "X4" , "'='" , "0" } , then iterate and if the sub-format is literal text, output it (Append to a StringBuilder), otherwise pass the sub-format to ToString and output the result.
The resultant process should then better match how I understand ToString should work with custom numeric formats.
|
|
|
|
|
|
Well, that, was easy. I just don't think it's enough to form its own article.
20.ApplyFormat ( "'0x'X\"=\"0d" ) yields "0x14=20d"
|
|
|
|
|
Seems easy, but a stupid question: What's ApplyFormat? It doesn't seem to be any .Net method for int.
|
|
|
|
|
Ah, see? Obfuscation. That's the Extension Method I just wrote.
|
|
|
|
|
That's what I thought
Well, if the implementation is more than one line perhaps you should still consider the article
|
|
|
|
|
Yeah, I think I will.
But I've also been directed to Customizing Format Strings[^], so I'll look through that to see if it may be a better or complementary technique.
|
|
|
|
|
I submitted the article, we'll see what happens.
|
|
|
|
|
Is this the right spot to ask questions about Visual Studio 2008 extensibility?
I am writing a Visual Studio 2008 Integration Package, using the SDK, and I would like to attach behavior code to the designer drag events (DragEnter, DragOver and DragDrop). I have a custom tool window with a list of available commands to our electronic measurement device. I want the ability to drag a command from that list onto the surface of a winform designer. Dropping the command item should automatically create the default control type and write the code that hooks it to the equipment command. Alternatively, I'd like it if the user could drag a command onto an existing control and have the connection code written.
I think I see how to automate the creation of controls and code in a Form designer, but I can't figure out how to hook that code to the designer drop event.
Thanks,
Aaron
|
|
|
|
|
As far as extending the designer capability for controls, one of my articles might be able to help you: Targeting Design-Time Events of UserControls[^].
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hello,
In VB.NET or C# (and generaly in DOT NET)
How to get the Owner / Creator of a document / file ?
I know hot to get modification date, creation date
but not the OWNER of the file.
How to access to the Security Attributes in order to get the OWNER ?
Best regards
|
|
|
|
|
Off the top of my head, you can use WMI and the System.Management namespace to get the Win32_LogicalFileSecuritySetting[^] object for that file. Call it's GetSecurityDescriptor method and that will return a Win32_SecurityDescriptor[^] object, which will have the information you're looking for in its Owner property.
|
|
|
|
|
Use the FileInfo.GetAccessControl() method to retrieve a FileSecurity object. Then call FileSecurity.GetOwner() to get the owner of the file.
|
|
|
|
|
Can someone please recommend me good resources on distributed computing and multithreaded programming that will get me started quickly but not be too brief in their usefulness...oh and doesn't cost an arm and a leg? Nothing really jumped out at me on Amazon.com. All the books I noticed were either $100+, written in the 90's or not rated.
Thanks
|
|
|
|
|
Not an answer, just a quick reading-tip; search for the article here on CP about "Legion"
I are troll
|
|
|
|
|
now, I want to delete one record on datagrid when I checked checkbox.
there is a checkbox on datagrid.
for example; if I checked checkbox on second row. The second row will deleted.(button click event)
how can i do this...
|
|
|
|
|
Did you try searching google first?
If so you may have found this[^].
I don't know how are you binding the grid with the data but as a simple solution, I would say just a do a postback when the checkbox is checked and use the RemoveAt method of DataRowCollection.
Be careful, there is no Undo Button(Ctrl+Z) in life.
|
|
|
|