Need To Retrieve Current Filename?

Aug 19, 2011

Let's say someone downloaded my program and renames it to whatever and then executes it.Which line do I need to retrieve the current filename?

View 1 Replies


ADVERTISEMENT

Insert Current Date And Time In Filename?

Aug 6, 2010

I have written some code that generates an output file from an external executable. I would like to insert the current date and time into the resulting filename. In the pi.Arguments line (shown below) the /l= creates the output file. I would like the name of the file to be Trustee_Restore_YYYYMMDD_HHMMSS.TXT.

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim p As New Process
Dim pi As New ProcessStartInfo

[code]....

Everything works, except I would like to insert the date into the output filename.

View 2 Replies

VS 2008 - DataGridView ImageColumn Retrieve Filename

Mar 20, 2012

I'm stuck at making an vacationplanner. For example: an employee can request a day off which request is send to an access database. After which the request has to be approved (or declined) by a supervisor. The supervisor logs in and goes to a overview form to see outstanding and approved request. I use a Datagridview to display the name of the employees at the Y-axis and the corresponding days in the selected month in the X-axis. Then I loop through the access database to fill the specific cells with an grey image on specific days for part-time employees.

After this I loop through a seperate accessdatabase to retrieve the outstanding and approved requests and fill the corresponding cells with an image. Example: yellow image for outstanding and green for approved requests.
dgvBezetting.Item(dag, rij).Value = Image.FromFile(Application.StartupPath() & "/uren/grijs.jpg")
Now I get to the part where I'm kind of stuck.

In the mentioned datagridview the supervisor can see the already approved requests. But, when an employee suddenly changed or canceled the already approved day off, the supervisor must be able to delete the request. I can find out with hitTest on which cell the supervisor has clicked and from there check the database for request entries, but this will consume a lot of database transaction when the supervisor keeps clicking on cells witch no data in it.

What I preferably want.....
I actually want to check if the clicked cell contains an image or not and from there on continue with an connetion to the database or not. But, I can't figure out how to retrieve the imagename or if there is an image used or not... I only get the result 'System.Drawing.Image', 'System.Drawing.Bitmap' or 'Image', nothing referencing to the imagefilename..

View 3 Replies

[2008] Retrieve The Selected Path And Filename From SaveFileDialog

Jan 23, 2009

I would like to use a SaveFileDialog to retrieve a path and filename.

Like for example: You choose a saving location and filename in the SaveFileDialog, and then when you press save the path and filename will be put in to a string as such: C:Folderfilename.txt

View 5 Replies

Asp.net - ASP, C#, And .Net Retrieve Current Line Number?

Oct 20, 2011

Does ASP, C#, VB.NET have a way to retrieve what line its on in code as its processing commands?

Example

1 <%
2 response.write("Your on line " & retreiveCurrentLineNumber)
3 %>

Output: Your on line 2

View 2 Replies

Retrieve Processes From Current User Only?

May 14, 2012

Dim Process As New Process()
Dim Count As Integer = 0
For Each Process In Process.GetProcesses(My.Computer.Name)

[code].....

I have that currently. What I want is instead of it loading ALL processes, I only want it to load processes from the current user. (ie. Ryan or Andrew, not SYSTEM or LOCAL.)'ve done research on Google looking how to implement and I've gotten some code on how to retrieve a User Name of the current user but nothing prevailed for what I needed :[ Any ideas? I'm noobish, taking Computer Science in Fall so I'm preparing and still learning.

View 4 Replies

Retrieve The Windows Current Username In XP?

Dec 1, 2009

How do I retrieve the windows current username in XP?

View 1 Replies

Web Browser - Retrieve The Current Page's URL?

Jan 11, 2012

I am a newbie to Visual BASIC, coming from Just BASIC , another great programming language, and I am trying to create a small web browser and was wondering if there is a way to retrieve the current page's URL?

View 2 Replies

Asp.net - Retrieve Current UserId And Insert Into Table?

Mar 16, 2012

Using the following code, a user inputs a date into a textbox control and then clicks a button. A new record is created in table [rms_Report] and then I retrieve the ID of the record that was just added. I pass this ID onto page "CreateReport.aspx" via a response.redirect and query string.

I need to retrieve the UserId of the currently logged in user and insert it into table [rms_Report]. I need this to occur after the new record is inserted, but obviously before the response.redirect. I know how to retrieve the UserId, but I'm not sure how to incorporate into the other code.

ASPX
<asp:SqlDataSource ID="ReportDataSource" runat="server"
OnInserted="ReportDataSource_Inserted"
ConflictDetection="CompareAllValues"

[Code].....

View 1 Replies

Retrieve The Current Weeks Dates From A DateTimePicker Control?

Jul 5, 2011

I am wanting to retrieve the current weeks dates from a DateTimePicker control.

Eg, if i select Tuesday July 5, 2011, i will return the following dates: Sun July 3 2011 right through to Sat 9 2011

View 5 Replies

Retrieve Current Function Arguments List Including Passed Value?

Sep 28, 2011

I wrote a Log class that details the exception, including the method name and its arguments list,but I couldn't find any way to programmaticly retrieve the arguments values.in some forums it was said that its impossible mission. I find it very odd.my arguments list looks like:

argA As String = ?
argB As integer (Opional, Default value = 2) = ?

etc. only actual values are missing.

View 9 Replies

VS 2008 Scan A Long String And Return Any Values That Occur Between The Tags <FileName> And </FileName>?

Jul 1, 2009

Quick query...I'm trying to scan a long string and return any values that occur between the tags <FileName> and </FileName> I've got a bit of code here to use regular expressions to return the position of the occurunces of both substrings..Just wanted to find out if there is any way to scan for both substrings within one loop (as im currently doing 2, one for the first substring and one for the 2nd) so I can use something along these lines:

ringlist = Mid(XMLRESP, (startloc + 1), (endloc - 1))
MsgBox(ringlist)

to msg box the value between the substrings...either that or another approach to return the value between the 2 substrings (it can be of variable length)

Dim patternstart As String = "<FileName>"
Dim patternend As String = "</FileName>"
Dim matchesstart As MatchCollection = Regex.Matches(XMLRESP, patternstart)

[code].....

View 3 Replies

Remove The Filename And Extract Just The Path Of The OpenFileDialog.Filename Property?

Oct 17, 2010

How would I do that? Sample code is below that demonstrated that the file I opened contained the full path and file name.

I want to extract just the path and serialize that to the user.config file as a UserSetting value. Then next time the user opens the dialog box, it uses that saved path string to go immediately to the location previously used.

If openFileDialog1.ShowDialog() = DialogResult.OK Then
Properties.Settings.Default.persistConnectionType = openFileDialog1.FileName
Properties.Settings.Default.Save();

[Code].....

View 3 Replies

Get The FileName For The Proces.Start(FileName) Method?

May 27, 2009

I have a Listview on my form with different files. I can selet a file en open it with the proces start method. To open the file i use the OpenFileDialog method and select the filename. This work very good. With the code below.

My question is if there is a method to get the selected file without using the OpenFileDialog Box. So when i dubbelclick the selected file the proces will start with open the selected file. Something like:

proc.StartInfo.FileName = Me.SelectedCell.FileName
instead of proc.StartInfo.FileName = Me.OpenFileDialog1.FileName

PS) May be i can preduce the Filename using the OpenFileDialog method on the background.

Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
If Me.OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then

[Code]....

View 8 Replies

Transform An Address Like File:///d:filename.ext In A D:filename.ext

Jun 26, 2009

how do you transform an address like "file:///d:filename.ext" in "d:filename.ext"

without dirty string manipulation??

View 4 Replies

Retrieve Keys From DLL Configuration File Not From Current EXE Configuration File?

Feb 7, 2011

I have 3 components :

1.Manager : dll containing Iterface definition and other things

2.Implementation: dll containing Implementation of the Interface

3.Executable: (maybe this one could be a external application or another dll using the libraries)

I have particular methods (iside the interface dll file) that extract information of real Implementation from AppSettings keys in order to instance it using reflection. I use the Manager inside the Excecutable, but when I try to retrieve a especific key defined in "Manager.dll.config" (appSettings), the value returned is empty because the configuration file used is "Excecutable.exe.config" I need this configuration information in Manager config file because this Manager will be used from other programs and the configuration must be centralized into that config file to replicate the possible changes to every app calling this dll.How can I to specify that the ConfigurarionManager.AppSettings must extract values from manager.dll.config file?

View 3 Replies

Asp.net - Clicking Link To Replace Current Frameset Contained In Current Window

Dec 28, 2011

I have following link in a.aspx file:

<a href="a.htm" target="iframe">A</a>

I want to set link from a.aspx.vb page according to what person is viewing the page. How can i change this so that if user clicks on link it will replace current frameset contained in current window with a url provided according to user?

Or in another way:

How will i replace href code in aspx page by giving it value from aspx.vb page?

View 1 Replies

Get Current Enumerator (iterator) In LINQ Query / Like A Current Index In For Loops

Sep 20, 2011

Is that possible to get current Enumerator (...or iterator? Don't know which tern is the correct one) in a LINQ query ? For example, I try to create a XML output (via LINQ to XML) of all currently loaded assemblies. [code] is it possible to somehow get current "index" (counter?) from LINQ's Selects? I would like to use it in XML. [code]

View 1 Replies

Keyup Event - Get The Current Value Of The Current Row And Column

Sep 12, 2011

I have a datagridview having 3 columns (qty,scraft factor,actuall qty). What I want is if the user encode 50 in qty and 2 in scraf factor, actuall qty will automatically computed based on qty multiply by 2. I was using keyup event. Now I am using endedit to get the current value of the current row and column, now the problem is if the amount to be encoded is more than one digit it will not accept because of endedit. What event do I have to used? or any solution with this scenario.

[Code]...

View 1 Replies

Asp.net: Get URL Without Filename

Dec 19, 2011

i want to set a link in VB.net dynamically to a file. My url looks like that:

[Code]...

View 3 Replies

Get Some Of A Filename?

Oct 17, 2009

i use this:

Try
' Create an instance of StreamReader to read from a file.
Using sr As StreamReader = New StreamReader("musik.txt")
Dim line As String

[code]....

In the line line = sr.ReadLine I dont want the full path Maybe i have c:lalalalamin.mp3 And i just want to show min.mp3?

View 7 Replies

Get The Filename Of The App?

Aug 8, 2009

I'm trying to figure out how to get the file name of the application at run time, in case it gets renamed.Also, as a easter-egg. First post, I don't know what code to put but this is how I am so far, the {FN} is where I need the file name.

If({FN} = "easter.exe") Then
msgbox("You found a easteregg! :O")
end

View 2 Replies

Use A # In A Filename?

Aug 14, 2010

I often use things like the crosshatch in filenames to group them together. Until recently this has not been a problem.

I am working modifing a WPF app which uses a Listbox to store images. I need the full path of the image to feed to a class to retrieve metadata.

The test image is named "# Canon-ixus.jpg".

Using Listbox.SelectedValue to return the filename I get "%23 Canon-ixus.jpg". There are not a whole lot of options to returning the name of the selected item from the Listbox.

Is there any simple way to get the name back to its original form?

View 10 Replies

.net - Incrementing The Filename?

Jun 7, 2011

Possible Duplicate: Way to get unique filename if specified filename already exists (.NET)Have a look at the following code:

Dim counter As Integer = 0
While System.IO.File.Exists("C:DesktopSample.xls")
counter = counter + 1

[code].....

View 5 Replies

.NET Reading The Filename?

Dec 8, 2010

I have a filename SBSA_UPLD_20101208 and I am interested in reading the Last date part which is 20101208. How can I do it?

View 1 Replies

Getting A Filename Out Of SaveFileDialog?

Mar 29, 2012

I am having trouble getting a filename out of my SaveFileDialog. I am using Framework 4.0, it works fine in 3.5.

Private Sub cmdExportToPDF_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdExportToPDF.Click
Dim SaveFileDialog1 As New SaveFileDialog()

[Code].....

View 2 Replies

Getting Filename From A String?

Dec 8, 2009

I am getting a filename in a String and need to get the name from this. An example:

Dim file As String = "Hello.png"
'I need to get "Hello". One way of doing it is:
Dim name As String = file.Split(ChrW(46)).First()

The problem with this method is; What happens if the filename contains a .?

[Code]....

View 1 Replies

How To Get Filename Faster

Mar 29, 2010

I have a directory with more then 350.000 files in. I need to process every single file and move them to an other folder. When I use the dir() method it takes a few seconds before if it returns the first file found.
dim foundfile as string = dir("d:")

In the documentation there is this:
"The My.Computer.FileSystem Object gives you greater productivity and performance in file I/O operations than the Dir function. See My.Computer.FileSystem.GetDirectoryInfo Method for more information."

But I can't find any method that is faster then dir, and gives the same result. I can't use this method below because it takes for ever to load......
For Each foundFile As String In My.Computer.FileSystem.GetFiles("D:")
Next
It just does not work fast...

When I use the Dir() method it takes like 5 sec, and it uses 100% cpu... it is just not a option. How do I get the same function as the dir method but better performance? (I use visual basic 2008).

View 8 Replies

See If A Filename Contains Substring In Vb?

Jun 27, 2012

This question was resolved in C#, and I don't know how to do it in VB net. I want to search through a directory of files and see if my string is contained within any of the filenames. Then I just need a bolean answer if it exists or not. I know how to use the file.exists...this is not what I need. The link below is to the C# response. How to check if filename contains substring in C#

[Code]...

View 1 Replies

Set The CommonSaveFileDialog.Filename?

Sep 1, 2009

In the XP SaveFileDialog, the user is allowed to set the SaveFileDialog.FileName.
I'm using Vista operating system and am using the VistaBridgeLibrary.dll so that I can get the Vista version of the Dialog Boxes. With the CommonSaveFileDialog (for Vista dialog), I'm unable to set the FileName property since it's read only.

Is there a way to populate the FileName so that when the DialogBox displays the filename in use is displayed?

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved