|
please show me the startig code and i will understand better
thank you
|
|
|
|
|
Here's some code that might give you an idea, since it takes a string, iterates through character by character, and tests each character. Obviously your test will be different, but it should get you on the right track. Taken from <a href="http://msdn.microsoft.com/en-us/library/system.string.chars.aspx">MSDN</a>[<a href="http://msdn.microsoft.com/en-us/library/system.string.chars.aspx" target="_blank" title="New Window">^</a>].
<pre lang="vb">Console.Write("Type a string : ")
Dim myString As String = Console.ReadLine()
Dim i As Integer
For i = 0 To myString.Length - 1
If Uri.IsHexDigit(myString.Chars(i)) Then
Console.WriteLine("{0} is a hexadecimal digit.", myString.Chars(i))
Else
Console.WriteLine("{0} is not a hexadecimal digit.", myString.Chars(i))
End If
Next
' The example produces output like the following:
' Type a string : 3f5EaZ
' 3 is a hexadecimal digit.
' f is a hexadecimal digit.
' 5 is a hexadecimal digit.
' E is a hexadecimal digit.
' a is a hexadecimal digit.
' Z is not a hexadecimal digit. </pre>
|
|
|
|
|
thank you for your help i ll try to do it and if i make it will let you know
thanks again
george
|
|
|
|
|
I've written an app in VB12, and if the user wants the app run from the Windows' Startup Folder, I'm trying to copy my executable from it's current residence to the Startup folder with
Environment.GetEnvironmentVariable("ALLUSERSPROFILE")
& "\Microsoft\Windows\Start Menu\Programs\Startup\" & My.Settings.ExeName)
where ExeName is a static constant in the My Settings object.
This works to give me the a valid path string to "C:\ProgramData\"{et. al.} - but I get an Access Error (Error 5) when my app tries to do a
FileIO.FileSystem.CopyFile(strCurrentAppName, strDestinationFileName) where strDestinationFileName is a concatenation of
Environment.GetEnvironmentVariable("ALLUSERSPROFILE") & "\Microsoft\Windows\Start Menu\Programs\Startup\" & My.Settings.ExeName
Can anyone give me a method that will work without User Rights Access business? I may try using "APPDATA" instead of "ALLUSERSPROFILE" in the interim.
Or if anyone has a better approach to getting an executable to run at Windows' Startup, I'm all ears...
modified 16-Sep-12 5:06am.
|
|
|
|
|
This is not really an issue with VB, but with the system. Access control exists in order to prevent you from doing what you are trying here, without being given permission from the owner of the system. You should set your program manifest to request administration rights and then, if the user grants it, your application will be able to write into these protected locations.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks Richard,
I knew that access rights was the problem, and the keyword answer for me is "Application Manifest". I wondered why it didn't prompt the user (me in this case) to decide whether or not to allow the program to write to the hard drive.
I should be able to alter the manifest accordingly.
Thanks again.
|
|
|
|
|
No problem; it's strange how the obvious is often the last thing we look at.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Actually, now a funny thing. I altered the app.manifest accordingly, and no matter what edit I had done, still I had "ring-around-the-collar" - Windows wouldn't let me write there because of Access rights.
At 6am, when I finally decided to call it a night and leave the problem to be revisited tomorrow-today (lol), I did a save all in VS12 and hit the magic "x". When VS shut down, it prompted me with a dialog saying that it "did not function correctly" and suggested that it log me in as administrator - and once it re-logged me in, it wrote just fine with the code that I had.
Moral of the story: Go ahead and give up, then Windows will allow your code to work correctly!!!
|
|
|
|
|
I guess you were trying to run the application from within a 'non-administrative' execution of Visual Studio. Had you run the enhanced app from a command prompt or Windows Explorer, then it probably would have done what you required. Yes, it's sometimes a pain, but much better than some cheap virus trashing your system.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
The "All Users" folder is only writable by account with admin priv's. If a normal user runs your app, they will never be able to write the shortcut (you ARE putting a shortcut and not the actual .EXE in there aren't you?!) to that folder.
If an admin rusns the app, it'll work just fine. If the system has UAC turned on, the user will get the UAC prompt to ask you if they want to use their admin priv's to do this. This won't work when launched from inside Visual Studio by the way.
Since "All Users" is considered a system setting, this makes perfect sense. If you want individual users to be able to pick whether they want this app to launch when they log in, you should be putting the shortcut in the users Startup folder, not All Users. Every user has read/write permissions to their own Startup folder.
|
|
|
|
|
HI everyone,
I wanted to display the report data in the range of 2 datetimepicker but I am not experience and knowledgeable in ReportViewer.
My situation:
Form1 is a form where user select a range of date between 2 datetimepicker then click the button to show the report in form2.
My query in query builder will be like this:
"Where (Date Between @Param1 AND @Param2)"
If there is better way like able to have selection like select monthly, yearly to display the report is even better.
I would really appreciate it, if someone can give me an example of coding and explanation. So far, I know how to create the report and dataset for it but the parameter part I am really out of Ideas.
|
|
|
|
|
Why my report menu does not have the "Report Parameter" selection expect for "Report Properties","Add Page Header","Add Page Footer","Ruler", and "Grouping"? How to get the Report Parameter out?
|
|
|
|
|
hi
Want to know more about Trace
What used to be
Thank
modified 14-Sep-12 13:20pm.
|
|
|
|
|
alirezamansoori wrote: apples
What kind of apples do you want to know more about? Red apples? Green apples? Yellow apples? Apple the company? What does this have to do with any kind of Visual Basic question?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
|
alirezamansoori wrote: trace
And what about trace? Are you looking for something like this[^]?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
They used to be seeds.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
That still doesn't help much, but I guess you are looking for something along these lines[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi, I'm new in vb.net
What the difference of these codes
for u = 0 to datatable.rows.count - 1
next
for each rows in datatable.rows
next
assuming process code are to parsing data datatable.rows either to search or to print or to calculate.
which one is faster ?
can someone give me some enlighment ?
sorry for bad english.
|
|
|
|
|
One loop is an indexer and the other is an enumator.
Indexers can modify the collection while you're iterating over it while enumators cannot.
Indexers are a little faster than enumerators, but also require you to know more about the size and types the array holds.
|
|
|
|
|
Thank You Dave. It clear my mind.
|
|
|
|
|
Just to add to Dave's comment - The for-loop is faster than the foreach-loop if the array must only be accessed once per iteration. (More Details with Benchmark Test[^]).
|
|
|
|
|
Thank you Pravin for the link. It gives me an understanding.
|
|
|
|
|
My pleasure yuifox... Happy coding
|
|
|
|