It is valid and works on the browser apart from the token which is modified
hm9
Posts
-
Query value is passed correctly but does not return any results in the query API string -
Query value is passed correctly but does not return any results in the query API stringI have a form that submit a query to an API. the parameter is passed correctly to the next page and I can print it as a test, but it is not passed to the API query
q='%"&Request.QueryString("id")&"%'
sometimes the result is just generic and does not include the query parameter. I can print it and the parameter is definitely passed to the page but it is just ignored or return an error: System.NullReferenceException: Object reference not set to an instance of an object. Any ideas on how to fix this? not sure if it is a formatting issue or the way the page is loaded.
This requests the query parameter and displays it on the page as a test (correct value is returned)
Form page:
dim intID as String
intID = Request.QueryString("id")
Response.write(intID)Result Page:
This is the Query Parameter section:
Dim doc As New XmlDocument()
doc.Load("http://api.tradedoubler.com/1.0/products.xml; q='%"&Request.QueryString("id")&"%';tdCategoryId=168;%20category=test?token=B17495243749DAC9660980F6FB98495928DDX123")So when I use the browser - copy the link to the url with a parameter e.g. q=spain, I get the correct results but when embedded in the asp.net page, it doesn't work
-
How to display/print name value in XML fileThanks Richard. That's exactly what I was looking for :)
-
How to display/print name value in XML fileIt s not a namespace issue. Everything works as far a namespace is concerned. I want to know how to drill to the name Attribute and get the values displayed. for instance, City or Zipcode values
-
How to display/print name value in XML fileI have a page in asp.net that queries an XML file and shows the data. It shows the data I need in the nodes, but I want to print the specific values deeper in the node… for instance I want to be able to print the value - PARIS or country France in the XML example below. with the line below I can only print the first element but I am not sure how to print the other values,Any advise on how this can be achieved? Note the rest of the code works and shows the other elements in the upper nodes, It s just I want to know how to display the name values or specific name value in the sample xml file below Asp.net Line Code: CityValue = node.SelectSingleNode("ns2:fields/ns2:field", nsManager).InnerText, _ XML:
EUR
3 Star
FRANCE
2.344952
48.872646
6950
PARIS
75009
-
Query XML API and display resultsHi I would like to query and display results from XML APIs (lINK) using Visual basic. I will have a search box with search parameters so the users can search the xml APi and get data displayed back on the browser or just the summary of the query indicating results so that users can click on the link and be redirected to the external site to view the details of their search, similar to comparison sites... Could you please advise on the best solution and approach for this? any examples, tutorials or samples to try first, would be great Thank in advance
-
Find and query files in a directory in date format yyymmddNot yet. It prints the path of the file rather than the file It should print:
20180117.LOG
but it is printing
d:\20180117.LOG
I only want the file so I can create a copy of it. Can you try it and see if works for you? may be format issue?
-
Find and query files in a directory in date format yyymmddOk. I tried somehting like this so I can print the last file - 1 it prints the file but with the file path as well
Object item = (((Deque) fileList).getLast()-1);
System.out.println(item); -
Find and query files in a directory in date format yyymmddYes. Just not sure how to do it in the code
-
Find and query files in a directory in date format yyymmddI just double checked the output printed is in ascending order as shown below: 20180115.LOG 20180116.LOG 20180117.LOG 20180118.LOG
-
Find and query files in a directory in date format yyymmddThanks for the suggestions. I made a start now by listing all the files with the extension .log and it works. since the files are in yyyymmdd.log format, i only want to list the last one - 1. then copy it to another file called logged.log for instance. Could you please help achieve this with the code below?. The code below navigate to the directory and list all files with the extension .log. The printed output is: 20180118.Log 20180117.Log 20180116.Log So I am interested in the second one: 20180117.Log
import java.util.List;
import java.io.File;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.regex.Pattern;class search
{
public static void main(String[] args) {String WILD\_CARD = ""; List fileList = new LinkedList(); File folder = new File("d:\\\\"); File\[\] listOfFiles = folder.listFiles(); if(WILD\_CARD!=null) { Pattern wildCardPattern = Pattern.compile(".\*"+WILD\_CARD+"(.\*)?.log",Pattern.CASE\_INSENSITIVE); for(File file: listOfFiles) { java.util.regex.Matcher match = wildCardPattern.matcher(file.getName()); while(match.find()){ String fileMatch = match.group(); if(file.getName().equals(fileMatch)) { fileList.add(file); // doesn't work } } } } else fileList = new LinkedList( Arrays.asList(folder.listFiles())); for (File f: fileList) System.out.println(f.getName());
}
}
-
Find and query files in a directory in date format yyymmddHi
I have a directory where log txt files are logged. Each log file has the following title date format 20180114.log, which is yyymmdd.
I want to search for data in the preceding file (date) so if the current date file is 20180114.log, I want to search the previous day 20180113.log, and then output the data i search for in anther text file.
How do I achieve this in java? any code examples I can follow?
I made a start by displaying the list of the files in the directory but could do with some help to achieve the above
public static void main(String[] args) {
File currentDir = new File("\\\\directory Path"); // current directory
displayDirectoryContents(currentDir);
}public static void displayDirectoryContents(File dir) {
try {
File[] files = dir.listFiles();
for (File file : files) {System.out.println(" file:" + file.getCanonicalPath());
}} catch (IOException e) {
e.printStackTrace();
}
}thanks in advance
-
How To Show A Message Or Page On Clicking Url Link Before Redirecting To An External pageI have a webpage in VB.net with a link so that when users click a url link, it directs them to an external website and it works but I want to add a extra layer so that it shows a message or intermediary page before the external page is loaded to the user. For instance, show a progress bar with delay and message stating "You are leaving this website" before showing or being redirected to the external page. I am using the code below to show the external link. Can you please help with this:
<a href = "<%# Eval("LinkUrl") %>" target="_blank"> Go to link</a>
Thanks in advance
-
Populate a Dropdown list based on another one in VB.NETHi
I want to be able to populate a drop down list based on the selection of another one or others using vb.net and also pass the value selected to another page or within the same page. for instance one drop down to select a country and a second one to populate the cities based on the first selection. I added one in the code below one below so need to add another one and populate it based on the selection in the first one. I am not using a Database. I just want the selection from the list as it is added manually.. Can you please advise of an example on how to achieve this or help exapand the code below . Thanks
<Script Runat="Server">
Sub Button_Click( s As Object, e As EventArgs )
if IsValid then
response.redirect ("test.aspx?id=" & countries.Text & " ")
end if
end sub
</script>Select a Country France Spain USA Italy England </form>